What is a variable?
A named location in memory that stores a value.
What keyword starts a decision in Python?
Answer: if
Which loop repeats a set number of times:
for loop
What is a comparison operator?
An operator that compares two values, such as ==, >, <.
What does sequencing mean in programming?
Running instructions in order, one after another.
In Python, what data type does input() return?
It always returns a string.
Fill in the missing keyword:
elif
What will this code output? 
It prints Hi three times.
What does the expression 5 % 2 evaluate to?
Answer: 1, because it gives the remainder.
Why do programmers use comments in their code?
To explain what the code does and make it easier to read.
What does assignment mean in programming?
Giving a variable a value using the equals sign.
What does an elif allow a program to do?
Check another condition if the previous one was false.
Give an example of something that could cause an infinite loop.
A while loop whose condition never becomes false (e.g., forgetting to update a variable inside the loop).
Why is >= different from >?
Answer: >= checks if a value is greater than or equal; > checks only greater than.
Put these steps in correct sequence:
1. Ask for the user’s name
2. Print a greeting
3. Store the name in a variable
1 → 3 → 2
What is the difference between an integer and a float?
An integer has no decimal places; a float is a number with decimals.
Why is indentation important in Python selection?
It tells Python which lines belong to the IF statement’s block of code.
What is the main difference between a for loop and a while loop?
A for loop repeats a fixed number of times; a while loop repeats until a certain condition is met.
What is the difference between / and // in Python?
/ gives a float (normal division), while // gives integer division and removes the decimal part.
Describe an algorithm to add two numbers input by the user
Ask for the first number, ask for the second number, convert them to integers, add them together, and output the result.
Explain why this code causes an error:
age is a string, so you can’t add it to an integer without converting it
Explain what a nested IF is and give an example of when you might need
A nested IF is an IF statement placed inside another. You might use it when checking two conditions one after the other, such as checking if someone passed an exam and then checking for a merit grade.
Explain the logical problem in the loop below and suggest one fix.
The password never changes inside the loop, so it repeats forever. You need to add password = input("Enter password: ") inside the loop.
Explain why this expression produces an error: 
You can’t join a string and an integer using +.
This program is supposed to add up 4 numbers entered by the user and then display the total. What is the problem with the code? 
Inside the loop, total is being replaced with number each time instead of adding to it. It should use total += number so the values are accumulated.