• 12 hours
  • Easy

Free online content available in this course.



Got it!

Last updated on 3/1/22

Structure Your Code in a Python Program

Log in or subscribe for free to enjoy all this course has to offer!

Evaluated skills

  • Structure your code in a Python program
  • Question 1

    Which of the following sets of class names is clearest?

    • DatabaseField, StringDatabaseField, DateDatabaseField

    • Level, Cave, Building

    • Button, Start, Quit

  • Question 2

    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.

  • Question 3

    An exception is raised in a function. When does the program crash?

    • Immediately.

    • Immediately, if it isn’t caught in that function.

    • When there are no more methods or functions to pass the exception up to.