What function is used to display something on the screen?
print()
for i in range(4):
print(i)
0 1 2 3
What is a collision in a game?
When two game objects detect that they have touched or overlapped.
name = input("Name: ")
if name = "Alex":
print("Hello Alex")
= should be ==
What data type is "Hello"?
String (str)
score = 0
for i in range(5):
score += 2
print(score)
10
What is an NPC?
Non-Player Character — a character controlled by the game rather than the player.
score = 0
if score > 100:
print("You win!")
else:
print("Keep playing!")
print needs to be indented
What symbol is used to assign a value to a variable?
=
What keyword can immediately stop a loop?
break
What is a Game Loop and what are its core phases?
The game loop is the central mechanism that runs continuously during gameplay to process data and render frames. Its three primary phases are Input Processing (capturing keyboard, mouse, or controller actions), Game Logic Update (calculating physics, AI behavior, and state changes), and Rendering (drawing the updated scene onto the screen). [1]
x = 5
y = 3
print(x + y * 2)
Output
11
Find the problem
x = 0
while x < 5:
print(x)
x is never increased, creating an infinite loop.
numbers = [1, 2, 3]
for i in range(4):
print(numbers[i])
The loop attempts to access numbers[3], which doesn't exist.
name = "Python"
print(name[2])
t