← return to practice.dsc10.com


Lecture 1 — Collected Practice Questions

Topics: Introduction.

Below are practice problems tagged for Lecture 1 (rendered directly from the original exam/quiz sources). By default, problems are sorted from easiest to hardest by average score; problems without a score are listed last.


Source: Question 3 from Spring 2024 Quiz 1

Problem 1

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 total growth is 29.7 - 24.5, which is 5.2 cm. To get the growth per day, divide by the 7 days. The parentheses are needed because division happens before subtraction. Without them, Python would compute 29.7 - (24.5 / 7).


Difficulty: ⭐️⭐️

The average score on this problem was 84%.


Source: Question 1 from Winter 2025 Quiz 1

Problem 2

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?

Answer: 68


Difficulty: ⭐️⭐️⭐️

The average score on this problem was 65%.


Source: Question 1 from Fall 2024 Quiz 1

Problem 3

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


Difficulty: ⭐️⭐️⭐️

The average score on this problem was 61%.