Advertisement
WupEly

Untitled

Feb 16th, 2023
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import sys
  2. import json
  3.  
  4. ints = {}
  5. floats = {}
  6.  
  7. for line in sys.stdin:
  8. pair = line.split("+")
  9. if "." not in pair[1]:
  10. ints[pair[0]] = str(int(pair[1]))
  11. else:
  12. floats[pair[0]] = str(float(pair[1]))
  13.  
  14. with open("research.json", "w") as json_file:
  15. json.dump({
  16. "geographical": ints,
  17. "physical": floats
  18. }, json_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement