Advertisement
azwri

filter

Feb 21st, 2020
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. import re
  2.  
  3. (lambda txt, _type: ''.join(re.findall(r'[0-9]', txt)) if _type == 'number' else ''.join(re.findall(r'[a-z-A-Z]', txt)))(input('Enter the text: ...'), input('Enter the type (number or string) ... '))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement