fork download
  1. # -*- coding: utf-8 -*-
  2.  
  3. d=(
  4. '0 204.3333\n'
  5. '1 216.3333\n'
  6. '2 230.6667\n'
  7. '3 237.3333\n'
  8. 'aaaa\n'
  9. )
  10. l = [x.split(' ') for x in d.split('\n') if len(x.split(' ')) > 1]
  11. data_dic = {i[0]: i[1] for i in l}
  12. print data_dic
  13.  
Success #stdin #stdout 0.01s 7896KB
stdin
Standard input is empty
stdout
{'1': '216.3333', '0': '204.3333', '3': '237.3333', '2': '230.6667'}