Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import json
- ints = {}
- floats = {}
- for line in sys.stdin:
- pair = line.split("+")
- if "." not in pair[1]:
- ints[pair[0]] = str(int(pair[1]))
- else:
- floats[pair[0]] = str(float(pair[1]))
- with open("research.json", "w") as json_file:
- json.dump({
- "geographical": ints,
- "physical": floats
- }, json_file)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement