Variables
Data Types
Operators
Input/Output
Comments
100

What is a variable in programming?

a named location used to store data

100

Name one numeric data type in Python.

int or float

100

What does the + operator do with numbers?

Adds them together.

100

How do you get input from the user in Python?

Use the input() function

100

How do you write a single-line comment in Python?

Use # before the comment

200

How do you assign a value of 5 to a variable called x?

x = 5

200

What data type is "hello"?

str (string)

200

What does the * operator do with strings?

Repeats the string. Example: 'a'*3 is 'aaa'

200

How do you display output in Python?

Use the print() function

200

Are comments run by the Python interpreter?

No, they’re ignored.

300

What happens if you try to use a variable that hasn’t been defined?

You get a NameError.

300

What is the type of the value 3.14?

float

300

What is the result of 5 % 2?

1 (modulus: remainder of division)

300

What data type does input() always return?

A string (str)

300

Why are comments useful?

They help explain code for humans.

400

What is the difference between = and ==?

= assigns a value, == compares.

400

What function do you use to check the type of a variable?

type()

400

What does // mean in Python?

Floor division (no remainder)

400

How would you get a number from the user and store it in a variable?

x = int(input("Enter a number: "))

400

How do you write a multi-line comment?

Use triple quotes (''' or """)

500

Can variable names start with a number in Python?

No, variable names can’t start with numbers.

500

What is the result of type(True)?

<class 'bool'>

500

What does != mean?

Not equal

500

How do you print multiple values at once?

Use commas in print(): print("Hi", name)

500

Write a comment above a line of code that adds two numbers.

# This line adds two numbers

M
e
n
u