709_To Lower Case
Input: "Hello"
Output: "hello"Solution:
def toLowerCase(str):
"""
:type str: str
:rtype: str
"""
# use build-in function in python
# return str.lower()
# use ASCII code
out = ''
for c in str:
if ord(c) <= 90 and ord(c) >= 65:
c = chr(ord(c) + 32)
out += c
return outLast updated