Advertisement
Guest User

new

a guest
Jan 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. import re
  2.  
  3. l = ['100', '100.1', 'ddd', '(100.1,102.4)']
  4.  
  5. l2 = list(map(lambda x: float(x) if re.match('\d+\.\d+', x) else x, l))
  6.  
  7. print(l2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement