Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- (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