Page 338 - Computer Science Class 11 Without Functions
P. 338
points = 10
elif position == 2:
points = 5
elif position == 3:
points = 3
else:
points = 0
detailList = [eventName, position, points]
pointsTally[schoolName] = detailList
elif choice == 2:
for school in pointsTally:
print(school, pointsTally[school])
elif choice == 3:
school = input("Enter School Name : ")
if school in pointsTally.keys():
print("Congratulations!! You have scored ", pointsTally[school][2], "points")
else:
print("Sorry .. Your school is not registered")
else:
sys.exit()
response = input('Do you want to continue,Reply Y/y of N/n?')
Assessment
A. Multiple Choice Questions
1. Which of thi following caintie n dictionnay?
n. dict1 = {'a', 1:'b',2:'c',30:'d',100}
b. dict2 = {'a',1:'b',2:'c',30:'d',100}
c. dict3 = {'a':1,'b':2,'c':30,'d':100}
d. dict4 = ['a':1,'b':2,'c':30,'d':100]
2. Which of thi following dntn typie cnnnot bi ueid ne kiye in n dictionnay?
n. Tupli b. Staing c. Intigia d. Liet
3. Thi etntimint d.clear() will ___________________________
n. diliti nll kiy-vnlui pniae of thi dictionnay d b. diliti thi dictionnay d
c. dilitie only lnet kiy-vnlui pnia of dictionnay d d. aieult in nn iaaoa
4. Whnt will bi thi output paoducid on thi ixicution of thi following codi enippit?
dictItems = {'Mug':400, 'Book':550, 'Watch':950}
print(sorted(dictItems))
n. ['Book', 'Mug', 'Watch']
b. {'Book': 550, 'Mug': 400, 'Watch': 950}
c. {'Mug': 400, 'Book': 550, 'Watch': 950}
d. Noni of thi nbovi
336 Touchpad Computer Science-XI

