What is a variable used for in Python?
A) Repeating code
B) Storing information
C) Drawing shapes
D) Stopping a program
Answer: B) Storing information
What is the purpose of a loop?
A) To stop a program
B) To repeat code multiple times
C) To store variables
D) To draw shapes
Answer: B) To repeat code multiple times
Which keyword is used to check a condition in Python?
A) if
B) repeat
C) loop
D) check
Answer: A) if
What does Python’s turtle module help programs do?
A) Play music
B) Draw graphics on the screen
C) Store variables
D) Run loops
Answer: B) Draw graphics on the screen
What is a bug in a program?
A) A computer virus
B) A mistake in the code
C) A type of loop
D) A turtle command
Answer: B) A mistake in the code
Which of the following correctly creates a variable called score with the value 10?
A) score == 10
B) score : 10
C) score = 10
D) 10 = score
Answer: C) score = 10
Which Python loop repeats code while a condition is true?
A) if
B) while
C) repeat
D) continue
Answer: B) while
What symbol means equal to in a Python condition?
A) =
B) ==
C) ===
D) :=
Answer: B) ==
Which command moves the turtle forward?
A) move()
B) walk()
C) forward()
D) go()
Answer: C) forward()
What does it mean to debug a program?
A) Delete it
B) Add graphics
C) Find and fix errors
D) Restart the computer
Answer: C) Find and fix errors
What will the variable x contain after this code runs?
A) 3
B) 5
C) 8
D) 15
Answer: C) 8
What will this loop print?
A) 1 2 3
B) 0 1 2
C) 0 1 2 3
D) 3 3 3
Answer: B) 0 1 2
What will this code print?
A) Big
B) Small
C) 10
D) Nothing
Answer: A) Big
What command turns the turtle right?
A) turn()
B) right()
C) rotate()
D) spin()
Answer: B) right()
What is wrong with this code?
A) Nothing
B) It should use == instead of =
C) print is wrong
D) x cannot be used
Answer: B) It should use == instead of =
Which of the following variable names is valid in Python?
A) 2score
B) player_score
C) player-score
D) score total
Answer: B) player_score
What would happen if a while loop condition never becomes false?
A) The program stops immediately
B) The loop runs forever
C) Python deletes the loop
D) The computer restarts
Answer: B) The loop runs forever
Which keyword is used to run code if the first condition is false?
A) then
B) else
C) next
D) continue
Answer: B) else
What shape would this code draw?
A) Triangle
B) Square
C) Pentagon
D) Circle
Answer: B) Square
What kind of error happens when Python cannot understand the code structure?
A) Logic error
B) Syntax error
C) Runtime error
D) Turtle error
Answer: B) Syntax error
What will be printed by this code?
A) 2
B) 4
C) 6
D) 8
Answer: D) 8
How many times will this loop run?
A) 3
B) 4
C) 5
D) Infinite
Answer: B) 4
What will this program print?
A) A
B) B
C) Not A
D) Nothing
Answer: C) Not A
How many sides would this code draw?
A) 3
B) 4
C) 5
D) 6
Answer: A) 3
What will happen if you run code that uses a variable that was never created?
A) The program runs normally
B) Python ignores it
C) You get an error
D) It becomes zero automatically
Answer: C) You get an error