What keyword is used to define a function?
Def
What keyword starts an if-statement?
if
Which keyword is used for a while loop?
While
What is a variable in Python?
A container for storing data
What type of data does input() return?
String
What is the correct way to call a function named greet?
greet()
What will if 5 > 3: do?
Execute the code inside the if-block. Indented
What is the risk of writing a while loop incorrectly?
It may create an infinite loop
Which of these is a valid variable name?
A) 1variable | B) my_variable | C) class | D) @name
B) my_variable
What is a Boolean value?
A data type with two values: True or False
What is the default return value of a function that does not return anything?
None
What does elif do in a conditional statement?
Adds an alternative condition
How do you stop an infinite loop without changing conditions?
Use a break
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"
What will type(3.14) return?
Float
What is an argument in a function?
A value passed into a function. Inside parameters.
What happens if you forget the colon (:) in an if statement?
Syntax Error
What does the break statement do?
Exits/ends the loop
Which error occurs if you use an undefined variable?
NameError
What will type(True) return?
bool or boolean
What does the return keyword do in a function?
Returns a value from the function
Do if statements use = or ==?
==
What will while True: do in Python?
Run the loop forever only if the Booleon is true
What is the difference between a global and local variable?
Local variables exist only inside functions
What will type(10 % 3) return?
Int