diff --git a/709-to_lower_case/python/709.py b/709-to_lower_case/python/709.py new file mode 100644 index 0000000..60b4667 --- /dev/null +++ b/709-to_lower_case/python/709.py @@ -0,0 +1,19 @@ +# 709. To Lower Case +# +# Given a string s, return the string after replacing every uppercase letter +# with the same lowercase letter. +# +# s consists of printable ASCII characters + +# apenas processar letras 'A-Z' +# codigo ASCII de 'A' = 65 e 'Z' = 90 + + +def toLowerCase(s: str) -> str: + resultado: str = "" + for index in range(len(s)): + if ord(s[index]) >= 65 and ord(s[index]) <= 90: + resultado += chr(ord(s[index]) + 32) + else: + resultado += s[index] + return resultado