Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- students = int(input('Enter the number of Students: '))
- i = 1
- dic = {}
- while i <= students:
- inp = input("Enter the names and marks of the Student: ").split(' ')
- dic[inp[0]] = inp[1:]
- i += 1
- get_item = input('Enter the name of the Student to calculate the Average: ')
- for k,v in dic.items():
- test_list = [int(i) for i in v]
- dic.update({k:test_list})
- if get_item in dic.keys():
- n = dic[get_item]
- print(sum(n)/len(n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement