Multiple Choice
Case Study 1:
1. class EventHandler:
2. def __init__(self) :
3. self.__queue = []
4. self.__eventKeeper = {}
5.
6. def addEvent(self, eventName) :
7. self.__queue.append(eventName)
8.
9. def registerCallback(self, event, func) :
10. self.__eventKeeper[event] = func
11.
12. def run(self) :
13. while(True) :
14. if len(self.__queue) > 0:
15. nextEvent = self.__queue.pop(0)
16. self.__eventKeeper[nextEvent]()
17. else:
18. print('queue is empty')
-Refer to the session in the accompanying Case Study 1. How would you call the function associated with the key 'mouse'?
A) self.__queue['mouse']
B) self.__eventKeeper['mouse']()
C) self.__eventKeeper('mouse')
D) self.__queue('mouse')
Correct Answer:

Verified
Correct Answer:
Verified
Q23: A queue enforces a first-come first-served strategy
Q24: Describe the static method in the video
Q25: Which of the following parts of an
Q26: A _ is a data structure that
Q27: The _ function causes the thread to
Q28: Describe the overall structure of an event-driven
Q30: Explain the difference between a single thread
Q31: What callback registration functions does the turtle
Q32: In a multithreaded class, the _ method
Q33: A Python-mangled name that is hidden outside