Skip to content

Commit

Permalink
Create hackerRank_swap_case.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Emperor-One authored Aug 17, 2023
1 parent b1648b2 commit ffa23ef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hackerRank_swap_case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def swap_case(s):
swapped_string = ''
for char in s:
if char.islower():
swapped_string += char.upper()

else:
swapped_string += char.lower()
return swapped_string

if __name__ == '__main__':
s = input()
result = swap_case(s)
print(result)

0 comments on commit ffa23ef

Please sign in to comment.