iq.lab
Python starts when a code cell comes near or you run one
easyLoops and basics target 15 min

To lower case

Return a new string: s with each capital letter from A to Z changed to its lowercase partner (A to a, B to b, and so on). Every other character stays as it is: lowercase letters, digits, spaces and punctuation.

Change the letters yourself, one character at a time: do not call lower(), casefold() or swapcase(). Every character of s comes from ASCII, the basic table that gives each English letter, digit and common symbol a number from 0 to 127, called its code.

Example 1
Inputs = "Hash Map"Output"hash map"

Only H and M change.

Example 2
Inputs = "SQL99"Output"sql99"

Digits stay as they are.

Example 3
Inputs = "group by"Output"group by"

There is no capital to change, so the answer equals the input.

Constraints
  • 0 ≤ len(s) ≤ 105, so s can be empty.

  • Every character is printable ASCII: codes 32 (a space) to 126 (~).

Plan it first

Write a line for each before you code, then say them out loud. Compare with the Approach tab afterwards.

⌘+Enter runs 0:00Python starts when a code cell comes near or you run one
Run examples checks the examples. Submit runs every test, including edge cases and, when the problem has one, a speed check on a large input.