Lab 2: Knowledge Check

Try to answer these questions on your own, to test your knowledge after working through the lab. Then click the button at the bottom to show the answers and check whether you were right or not. If you get a question wrong and don't understand why, that's a good sign that you should study that topic before the next quiz.

  1. The type of the value that results from the input function depends on what the user types when the program is run.
    True False
  2. In Python, one line of code can be more than one step of the program.
    True False
  3. Which of the following expressions evaluates to a number? (pick one or more)
    1. len('hello')
    2. int('hello')
    3. int('25')
    4. int(input('How are you feeling? '))
  4. Which of the following statements about automatic test cases are true? (pick one or more)
    1. They help you understand a problem before you start to write code.
    2. They should only be written after your code is complete.
    3. They are like a rough draft of your code, where most of the functionality is present but not necessarily working yet.
    4. They help you catch and identify bugs in your code.

Table of Contents