Professional Documents
Culture Documents
Jinitha mol k
S3 EEE
PKD21EE030
ROLL NO-30
1) Write a Python program to store the student details (Rollno,name & mark) as a dictionary. Use
rollno as the key for the dictionary and a tuple containing name & mark as value. Display the
details
of all students. Also display the details of the student having the highest mark.
Example:
def students(n):
marks_report = {}
for i in range(n):
print(marks_report)
n = int(input("Enter No of Students:"))
students(n)
2) Write a Python program to store the student’s attendance details (Rollno,Name & Attendance
percentage) into a text file. Display the complete attendance report. Also display the details of
D = dict()
# to the dictionary
for i in range(0,n):
x, y = input("Enter the complete name (First and last name) of student: ").split()
D[x, y] = (z, m)
def sort():
ls = list()
# items() method
tup = (sname[0],sname[1])
ls.append(tup)
ls = sorted(ls)
for i in ls:
print(i[0],i[1])
return
# in stored data
def minattend():
ls = list()
# items() methods
ls.append(details[1])
ls = sorted(ls)
return
def searchdetail(fname):
ls = list()
tup=(sname,details)
ls.append(tup)
for i in ls:
if i[0][0] == fname:
print(i[1][0])
return
def option():
4: Exit\n \
Option: '))
if choice == 1:
# function call
sort()
inp = input()
if inp == 'Y':
option()
exit()
elif choice == 2:
minattend()
print('Want to perform some other operation??? Y or N: ')
inp = input()
if inp == 'Y':
option()
exit()
elif choice == 3:
searchdetail(first)
inp = input()
if inp == 'Y':
option()
exit()
else:
exit()
option()