forked from Adeelzafar/PythonTraining
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjson.py
More file actions
33 lines (31 loc) · 1.14 KB
/
Copy pathjson.py
File metadata and controls
33 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
person = {}
while True:
print("1. Add Person/n", "2. Delete Person/n", "3. Exit")
inp = int(input())
if inp == 1:
p = input('Enter Person Name')
person[p] = {}
person[p]['occupation'] = []
person[p]['education'] = []
while True:
print("1. Enter Occupation # To Break/n", "2. Enter Education # To Break/n", "3. Exit")
inp = int(input())
if inp == 1:
occupation = {}
while True:
key = input("Enter Key")
if key == '#': break
value = input("Enter Value")
occupation[key] = value
person[p]['occupation'].append(occupation)
elif inp == 2:
education = {}
while True:
key = input("Enter Key")
if key == '#': break
value = input("Enter Value")
education[key] = value
person[p]['education'].append(education)
elif inp == 3: break
elif inp == 3: break
print(person)