Guest User

Untitled

a guest
Jul 13th, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. text = input()
  2. lower_case = []
  3. upper_case = []
  4. mixed = []
  5. replacements = (',',';', ':', '. ', '!', '(', ')', '"', "'", '\\', '/', '[', ']',"''",'  '," .",'.')
  6. for r in replacements:
  7.     text = text.replace(r, ' ')
  8.        
  9. words = [word for word in text.split()]
  10. for word in words:
  11.     if word== word.lower() and word.isalpha() == True:
  12.         lower_case.append(word)
  13.     elif word== word.upper() and word.isalpha() == True:
  14.         upper_case.append(word)
  15.     else :
  16.         mixed.append(word)
  17.  
  18. print('Lower-case: ' + ', '.join(lower_case))
  19. print('Mixed-case: ' + ', '.join(mixed))
  20. print('Upper-case: ' + ', '.join(upper_case))
Add Comment
Please, Sign In to add comment