mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
Modified comments on lower.py (#10369)
This commit is contained in:
parent
c85506262d
commit
1117a50665
|
@ -14,9 +14,9 @@ def lower(word: str) -> str:
|
||||||
'what'
|
'what'
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# converting to ascii value int value and checking to see if char is a capital
|
# Converting to ASCII value, obtaining the integer representation
|
||||||
# letter if it is a capital letter it is getting shift by 32 which makes it a lower
|
# and checking to see if the character is a capital letter.
|
||||||
# case letter
|
# If it is a capital letter, it is shifted by 32, making it a lowercase letter.
|
||||||
return "".join(chr(ord(char) + 32) if "A" <= char <= "Z" else char for char in word)
|
return "".join(chr(ord(char) + 32) if "A" <= char <= "Z" else char for char in word)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user