-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.py
More file actions
38 lines (34 loc) · 742 Bytes
/
project.py
File metadata and controls
38 lines (34 loc) · 742 Bytes
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
34
35
36
37
38
import json
data={
"users":[
{
"name":"nimi",
"age":""
},
{
"name":"shgj"
}
]
}
def inputing():
#_name=input("Enter the name:-")
#_age=int(input("Enter the age:-"))
#_mobno=input("Enter the mobile number:-")
#_email=input("Enter the email:-")
#_dob=input("Enter the date of birth:-")
a={
"name":1,
"age":1,
"mobno":1,
"email":1,
"dob":21
}
with open('dat.json','w') as f:
dt=json.dumps(data)
json.dump(dt,f)
print(type(dt))
with open('dat.json','r') as f:
nd=json.loads(json.load(f))
for d in nd['users']:
print(d['name'])
inputing()