Quiz: Python Classes
Main.PythonQuiz13 History
Hide minor edits - Show changes to markup
- Correct. '_init_' function with 2 underscores on either side of init
- Correct. 2 underscores on either side of init
(:title Quiz: Python Classes:) (:keywords quiz, test, Python, plot, graph, class, object, instance, introduction, course:) (:description Learning assessment on Python data import with Pandas and TCLab.:)
1. Classes are collections of variables and functions that are particularly useful in object-oriented programming.
(:div id=q1a:)
- Correct.
(:divend:)
(:div id=q1b:)
- Incorrect.
(:divend:)
2. In the example in the video introduction to classes, what is an instance of the Person class? Select two correct answers.
(:div id=q2a:)
- Correct. Jane is an instance of the parent class.
(:divend:)
(:div id=q2b:)
- Incorrect. The parent class is not an instance.
(:divend:)
(:div id=q2c:)
- Correct. Eric is an instance of the parent class.
(:divend:)
(:div id=q2d:)
- Incorrect. The function addSkill is a method of the Person class, not an instance of the Person class.
(:divend:)
3. What function is used to initialize variables when creating a new instance of a class?
(:div id=q3a:)
- Incorrect.
(:divend:)
(:div id=q3b:)
- Incorrect.
(:divend:)
(:div id=q3c:)
- Correct. '_init_' function with 2 underscores on either side of init
(:divend:)