-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path13_user_record.py
More file actions
64 lines (50 loc) · 1.43 KB
/
13_user_record.py
File metadata and controls
64 lines (50 loc) · 1.43 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#Program to process User Record
d=dict()
n=int(input("How many students' record you want to store"))
for i in range(0,n):
a,b=input("Enter the first and last name of the student").split()
c=input("Cntanct Number")
m=input("Enter avg marks: ")
d[a,b]=(c,m)
def maxmarks():
l=list()
for name,detail in d.items():
l.append(detail[1])
l=sorted(l)
print("Maximum marks:",max(l))
return
def searchdetail(fname):
ls = list()
for sname,details in d.items():
tup=(sname,details)
ls.append(tup)
for i in ls:
if i[0][0] == fname:
print(i[1][0])
return
def options():
j=int(input("""Enter your choice\n
1. To find maximum marks\n
2. Search contact using First name\n
3. Exit\n
"""))
if(j==1):
maxmarks()
print("Want to execute any other operation? y/n:")
i=input()
if(i=='y'):
options()
else:
exit()
elif(j==2):
searchdetail(input("Enter the first name of student: "))
print("Want to execute any other operation? y/n:")
i=input()
if(i=='y'):
options()
else:
exit()
else:
print("Thanks for executing the program!")
return
options()