Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- l = ['100', '100.1', 'ddd', '(100.1,102.4)']
- l2 = list(map(lambda x: float(x) if re.match('\d+\.\d+', x) else x, l))
- print(l2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement