Python Math
Variables & Input
Graphics & Coordinates
Functions & Events
Code & Computer Science
100

What does print(9 / 2) display in Python 3?

4.5

100

Which Python function displays a message and waits for a user to type a response?

`input()`.

100

What are the coordinates of the top-left corner of a CodeHS graphics canvas?

(0, 0).

100

What do we call a function passed to another function so it can be called later?

A callback function.

100

What is code?

Instructions written in a programming language for a computer to execute.Back to board


200

What is the value of 19 % 4?

3

200

Write a statement that stores the whole-number value entered for the number of siblings in an integer variable named `siblings`.

`siblings = int(input("How many siblings do you have? "))`.

200

A canvas is 500 pixels wide and 300 pixels tall. What is the center coordinate?

(250, 150).

200

What programming approach runs code in response to a mouse click or key press?

Event-driven programming.

200

Is a smart thermostat an example of a computing device? Explain briefly.


Yes. It processes information and can execute programmed instructions.



300

What does print(5 * 3 + 8 / 4) display?

17.0

300

What is printed by `first = "Mia"; last = "Park"; print(first + " " + last)` when each statement is on its own line?


`Mia Park`.

300

A program creates a circle with `ball = Circle(25)` and positions it with `ball.set_position(90, 60)`. What does (90, 60) represent?

The x- and y-coordinates of the circle's center.

300

You want `draw_square` to run on each click. Should you register `draw_square` or `draw_square()` as the callback?

Register `draw_square` without parentheses.

300

In AP pseudocode, what does `←` mean?

Assignment: store the value on the right in the variable on the left.


400

A teacher has 29 pencils and puts them into boxes of 8. Write an expression to find the pencils left over.

29 % 8

400

Trace this code: `score = 12`; `backup = score`; `score = 20`. What is the value of `backup`?

12. `backup` keeps the value copied when the assignment happened.


400

A program creates a rectangle named `box` and sets its position, but nothing appears. What additional statement should be used?

`add(box)`.

400

A click handler receives an event object `event`. What information might `event.x` and `event.y` provide?

The x- and y-coordinates of the mouse click.Back to board


400

Trace these assignments: `a ← 4`, `b ← 11`, `c ← a`, `a ← b`, `b ← c`. What is the final value of `b`?


4. `c` stored the original value of `a`, then that value was assigned to `b`.


500

What is printed by x = 7 * 3 + 10 / 4; print(x) if written as two valid Python statements on separate lines?

23.5

500

In AP pseudocode: `p ← 6`, `q ← p`, `p ← 15`, `r ← q`. What value is stored in `r`?


6. `q` received 6 before `p` was changed.

500

A circle has a diameter of 70. What radius should be passed to `Circle()` to draw it at the correct size?

35, because radius = diameter ÷ 2.

500

A click handler creates a circle at the event's coordinates and adds it to the canvas. If the user clicks four different locations, what should happen?

Four circles should appear, one at each clicked location, assuming each click creates and adds a new circle.



500

Explain why `backup = total` does not automatically change `backup` when `total` is later assigned a new number.


The assignment copies the current value into `backup`; later reassignment of `total` does not automatically update `backup`.