Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Python/togglechar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#take user input
String = 'GuDDuBHaiyA'
#initialize other empty String
String1 = str()
#iterate through String
for i in String:
#check the case of each iterator
if i.isupper():
#change it to opposit case
i = i.lower()
#Concat each iterator to String1
String1 = String1 + i
else:
i = i.upper()
String1 = String1 + i
#print String1
print(String + ' after changing ' + String1)