Page 224 - Information_Practice_Fliipbook_Class11
P. 224
School Name - string
Event Name- string
Position - integer
A school can participate in any one of the following events: Quiz, Hackathon, Gaming, Coding, and Image Editing. The points
will be assigned according to the position as given below:
Position Value Points
1 10
2 5
3 3
Further, he would like to store and display the resulting data in the form of a dictionary:
School Name - string
Event Name- string
Points - integer
Help Ruhan develop a menu-driven program.
Ans: import sys
events = ('Quiz', 'Hackathon', 'Gaming', 'Coding', 'Image Editing')
pointsTally = {}
response = 'Y'
while response in ['Y', 'y']:
print("MAIN MENU")
print("1. Accept Data")
print("2. Display Data")
print("3. Display Points")
print("4. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
schoolName = input("Enter the School Name : ")
choice = 1
while choice == 1:
eventName = input("Enter the Event Name : ")
if eventName not in events:
print("Sorry... we are not hosting this event.")
choice = int(input("Press 1 to enter Event again or 2 to Exit"))
if choice == 1:
continue
else:
sys.exit()
210 Touchpad Informatics Practices-XI

