Last updated on 1/26/21
Structure Your Code in a Python Program
- Structure your code in a Python program
Which of the following sets of class names is clearest?
DatabaseField, StringDatabaseField, DateDatabaseField
Level, Cave, Building
Button, Start, Quit
Which of the following happen when a module is imported? (It could be multiple answers!)Careful, there are several correct answers.
The class and method definitions in that file are loaded.
All the imports in that module are imported too.
All the code in that module is executed.
An exception is raised in a function. When does the program crash?
Immediately, if it isn’t caught in that function.
When there are no more methods or functions to pass the exception up to.