← return to practice.dsc10.com
Below are practice problems tagged for Lecture 1 (rendered directly from the original exam/quiz sources).
What does the following expression evaluate to? Write your answer exactly how the output would appear in Python.
5 * (4 ** 3 - 40) / (2 * 8) ** .5 + 10 / 3 + 2 * (5 / 6 - 1 / 2)
Answer: 34.0
The average score on this problem was 61%.
You are tracking the growth of a flower stem over a seven-day period. The flower stem starts out at 24.5 cm and ends up at 29.7 cm.
Write one line of code that calculates the average daily growth, in
centimeters, and assigns the result to the variable
avg_growth. Do not round your answer.
Answer:
avg_growth = (29.7 - 24.5) / 7
The average score on this problem was 84%.
The Cheese Club currently has 50 members. Each quarter, the number of people who will join the club is the value of the Python expression below.
3 * ((4 * 20 / 5 * 2 + 4) ** 0.5 - 2 ** 2)
How many members will the club have after 3 quarters?
56
68
74
82
None of these.
Answer: 68
The average score on this problem was 65%.