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.
s = "Hash Map"Output"hash map"Only H and M change.
s = "SQL99"Output"sql99"Digits stay as they are.
s = "group by"Output"group by"There is no capital to change, so the answer equals the input.
0 ≤ len(s) ≤ 105, so
scan 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.