Pop Quiz #8.1 (Class & OOP)
- Due Mar 9, 2022 at 11:59pm
- Points 20
- Questions 14
- Available after Mar 2, 2022 at 1:30pm
- Time Limit None
- Allowed Attempts 2
Instructions
- In Python, there is a flexibility that class/static/instance variables/methods can be added as "needed" outside the class definition.
- However, it may cause confusions. In this and next quizzes, we are going to exercise this flexibility and clarify the confusions it may raise.
- It is recommended, at least for the programming beginners, to declare all the class (static) and instance variables in the class definition.
- Methods may be added as "needed" if they will cause less confusion.
class A:
# declare all the class variables here.
def __init__(self):
# declare all the instance variables here
# class/static/instance method may be added later outside the class definition.
Only registered, enrolled users can take graded quizzes