Skip to content

Commit c20a478

Browse files
sethusankaramaank404dhruvmanila
authored
Modified comments on upper.py (TheAlgorithms#3884)
* Modified comments on upper.py ,made it more clean * Update strings/upper.py Co-authored-by: xcodz-dot <[email protected]> * Update upper.py * Update upper.py Co-authored-by: xcodz-dot <[email protected]> Co-authored-by: Dhruv Manilawala <[email protected]>
1 parent 1ea3d84 commit c20a478

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

strings/upper.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def upper(word: str) -> str:
1212
'WH[]32'
1313
"""
1414

15-
# converting to ascii value int value and checking to see if char is a lower letter
16-
# if it is a capital letter it is getting shift by 32 which makes it a capital case
17-
# letter
15+
# Converting to ascii value int value and checking to see if char is a lower letter
16+
# if it is a lowercase letter it is getting shift by 32 which makes it an uppercase
17+
# case letter
1818
return "".join(chr(ord(char) - 32) if "a" <= char <= "z" else char for char in word)
1919

2020

0 commit comments

Comments
 (0)