Variables & Types
Printing & str()
input() & Conversion
PEMDAS & Tiny Math
Debug This!
100

What are the 3 parts of locker_number = 127?

name / = / value

100

Join text and a name stored in student_name

print("Student: " + student_name)

100

Write a full-question prompt asking for a name.

input("What is your name? ")

100

Evaluate: 10 + 2 * 3

16

100

Fix: Print("Hi")

print("Hi")

200

What type is "42" vs 42?

"42" → str, 42 → int

200

Fix: print("Total: $" + total)

print("Total: $" + str(total))

200

Read an age as an integer

age = int(input("How old are you right now? "))

200

Average of 84 and 90 with correct parentheses

(84 + 90) / 2

200

student name = "Ava"

student_name = "Ava"

300

What type does input() return?

str (string)

300

Why do we need str() here?

Because + can only join strings; numbers must be converted

300

Why might int(input(...)) crash?

Blank input or non-digits (e.g., “abc”)

300

Show a division that gives 1.5 using 3 and 2

3/2.0 or float(3)/2

300

Predict output:

g = 10
print("G=" + str(g))



G=10

400

Write a valid variable name for grade level

grade_level

400

Print exactly: Grade: 10 using the variable g = 10

print("Grade: " + str(g))

400

Read price (float) and qty (int), store in price, qty

price = float(input(...)) and qty = int(input(...))

400

Round 5.678 to two decimals in a print line with $

print("Total: $" + str(round(5.678, 2)))

400

Fix:

qty = input("How many? ")
total = qty * 1.50


qty = int(input("How many? "))

500

Change "15" (string) into a number you can add with

int("15") (or float("15"))

500

Show two different correct prints for score = 95

"Score: " + str(score) and "95" via print("Score: " + str(95))

500

Student presses Enter on a prompt. What does input() return?

Empty string ""

500

Compute subtotal for qty and price and print it with $.

print("Subtotal: $" + str(qty * price)) (if qty/price already numeric)

500

Fix order: avg = 80 + 90 / 2


avg = (80 + 90) / 2