Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Last active May 8, 2021 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/aec013de721a3083c5cd49840a54d15e to your computer and use it in GitHub Desktop.
Save computer-tutor/aec013de721a3083c5cd49840a54d15e to your computer and use it in GitHub Desktop.
f1 = open('LOWER.txt', 'w')
f2 = open('UPPER.txt', 'w')
f3 = open('OTHERS.txt', 'w')
c = True
while c:
c = input('Enter a character to write or exit to terminate the program : ')
if c=='exit':
break
elif c.islower(): # checks for lower character
f1.write(c)
elif c.isupper(): # checks for upper character
f2.write(c)
else:
f3.write(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment