fork download
  1. import sys
  2.  
  3. lines = sys.stdin
  4. for line in lines:
  5. try:
  6. x, y = map(float, line.split(',')[:2])
  7. except ValueError:
  8. continue # skip invalid (for whatever reason) lines
  9. else:
  10. # use x, y here
  11. x *= 10000
  12. y *= 10000
  13. z = 0.0
  14. print(x, y, z)
Success #stdin #stdout 0.01s 7856KB
stdin
1,2
# the next line is blank AND IT IS SUCCESSFULLY SKIPPED NO 0,0

# missing second field
70,
# both empty
,
# first empty
,0
# 
,,80,90
3,4
stdout
(10000.0, 20000.0, 0.0)
(30000.0, 40000.0, 0.0)