fork download
  1. import re
  2. s = '(a,1.0),(b,6.0),(c,10.0)'
  3. print(dict(map(lambda (w, m): (w, float(m)), [(x, y) for x, y in re.findall(r'\(([^),]+),([^)]*)\)', s) ])))
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
{'a': 1.0, 'c': 10.0, 'b': 6.0}