Eric Park | e9b663b | 2019-05-09 18:17:11 +0800 | [diff] [blame] | 1 | import json |
2 | |||||
3 | user_list = [] | ||||
4 | |||||
5 | user = {} | ||||
6 | |||||
7 | user["name"] = input("Name: ") | ||||
8 | user["email"] = input("Email: ") | ||||
9 | user["device"] = [] | ||||
10 | |||||
11 | while True: | ||||
12 | device_name = input("Device codename (type -1 to end): ") | ||||
13 | if device_name == "-1": | ||||
14 | break | ||||
15 | user["device"].append(device_name) | ||||
16 | |||||
17 | user_list.append(user) | ||||
18 | |||||
19 | print("Finished! Please give the following output to Eric:") | ||||
20 | print(json.dumps(user_list, indent=4)) |