Practice - 1 (Lesson1)
Practice - 1 (Lesson1)
PRACTICE 1 (LESSONS 1)
ANSWERS
Please record your answers here for the questions below:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
QUESTIONS
Fill in the blank
3. A ________ language is one that is designed to be easy for humans to read and
write.
Multiple Choice:
5. Select the following variable names which are both legal and follow expected Python
naming conventions.
6. Select the equation(s) below which evaluate to 42. Hint: Pay attention to PEMDAS
and type.
a. (4 + 8) * (6.5 – 3)
b. (1 + 2)**(5 – 2) + 5 * 3
c. 2**3 * 3**2 + 6 + 4/2
d. (1 + 2)**3 + (5 – 1) * 3 + 4 – 1
e. 3 * 7 + 6/2 * (4 +3)
7. The equation to calculate the volume of a cone with height h and radius r is
1 2
V = π r h. What is the volume of a cone with a radius of 2 and a height of 3 to two
3
decimal places? Use 3.14 for the value of π .
8. A group of 266 persons consists of men, women, and children. There are four times
as many men as children, and twice as many women as children. How many children
are there?
9. If the sum of three consecutive numbers is 72, what is the largest number?
10. What is the value of x after the following statements are executed?
x = 'py'
x += 'thon'
y = z = '42'
x += y + z
x *= 2
Copyright
These course materials have been adapted from Allen B. Downey’s Think Python, 2nd edition
(http://greenteapress.com/wp/think-python-2e/)
Permission is granted to copy, distribute, and/or modify the course materials under the terms of the Creative
Commons Attribution-Non Commercial 3.0 Unported License, which is available at
http://creativecommons.org/licenses/by-nc/3.0/.