Advertisement
simeonshopov

Digits, letters and other

Feb 10th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. digits = ''
  2. letters = ''
  3. other = ''
  4.  
  5. text = input()
  6.  
  7. for ch in text:
  8.     if ch.isalpha():
  9.         letters += ch
  10.     elif ch.isdigit():
  11.         digits += ch
  12.     else:
  13.         other += ch
  14.  
  15. print(f'{digits}\n{letters}\n{other}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement