azwri Feb 21st, 2020 (edited) 115 Never
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) ... '))
RAW Paste Data