Functions
Conditionals
Loops
Variables
Data Types
100

What keyword is used to define a function?

Def

100

What keyword starts an if-statement?

if

100

Which keyword is used for a while loop?

While

100

What is a variable in Python?

A container for storing data

100

What type of data does input() return?

String

200

What is the correct way to call a function named greet?

greet()

200

What will if 5 > 3: do?

Execute the code inside the if-block. Indented

200

What is the risk of writing a while loop incorrectly? 


It may create an infinite loop

200

Which of these is a valid variable name? 

A) 1variable | B) my_variable | C) class | D) @name

B) my_variable

200

What is a Boolean value?

A data type with two values: True or False

300

What is the default return value of a function that does not return anything?

None

300

What does elif do in a conditional statement?

Adds an alternative condition

300

How do you stop an infinite loop without changing conditions?

Use a break

300

How do you assign a string value to a variable? 

A) name = "John" | B) name == "John" | C) "John" = name | D) assign(name, "John")

A) name = "John"

300

What will type(3.14) return?

Float

400

What is an argument in a function?

A value passed into a function. Inside parameters.

400

What happens if you forget the colon (:) in an if statement?

Syntax Error

400

What does the break statement do?

Exits/ends the loop

400

Which error occurs if you use an undefined variable?

NameError

400

What will type(True) return?

bool or boolean 

500

What does the return keyword do in a function?

Returns a value from the function

500

Do if statements use = or ==?

==

500

What will while True: do in Python?

Run the loop forever only if the Booleon is true

500

What is the difference between a global and local variable?

Local variables exist only inside functions

500

What will type(10 % 3) return?

Int

M
e
n
u