Quiz Answers\Module 1

Module 1

 

1. What is the output of this code? 

           

            print "I have", 5, "cats."

 

ANSWER: I have 5 cats

 

 

2. The Python ______ is a set of rules for writing code, while the Python ______ is a program which reads code and executes it.

 

ANSWER: language, interpreter

 

 

3. Which if statement is correct?

 

            a) if num_cats is 5: 

           

            b) if num_cats == 5

           

            c) if volume == 7.3:

 

            d) if volume ! 7.3:

 

ANSWER: c

 

 

4. Is cat_on_a_hot_tin_roof an acceptable variable name?

 

ANSWER: yes

 

 

5. Is 7_cities_of_gold an acceptable variable name?

 

ANSWER: no, it begins with a number

 

Top of Page