Just Python
PYGAME Zero
Comp Sci Theory
PGZ Code
Fun Things
100

What is z after the following python code?

x = 6

y = x -2

z = x + y

z equals 10

100

What does the draw loop do?

Draw the items of the game. 

100

Why do most programs have input and output?

To interact with the user. Input allows the user send the program data and output shows the user the result of the program.

100

How to detect when a player presses the space button?

keyboard.space

100

ants?

ANTS!

200

What does the following python code do?

name = input("What is your pet's name?")

print(name, "I like that name!")

It takes input from the user and will print the input the user entered followed by I like that name. 

200
What does the update loop do?

Update the variable and data in the game. 

200

What are the two main types of loops? 

For loop (do for a set number of times)

While loop (do while something is true)

200

What will this piece of code do?

player.x = player.x + 2

Will move the players x position to the right. 

200

Why are problems in a program called a bug?

Actual bug where found in the computer causing issues

300

If x is 8 what is y after the following python code?

if x > 10 or x == 1:

    y = 1

elif not (x > 3 and x < 7 ):

    y = 2

else 

y = 3

Y = 2 

300

How do we make a new item in the game? 

Create an actor with the Actor function. 

300

What is an infinite loop and why would you use it? 

A loop will run forever -> you want the loop to run forever - you want the program to always be checking to something

300

What data structure could you use to keep track of multiple enemies in a game?

List

300

What is behind the giant screen right now?

A Chicken

400

What is y set to after the following python code?

list = ["a", "b", "c", "d", "e"]

y = list[3]

y = "d"

400

Why do we use an update loop in a game?

So we can respond to player input and change values, images, based on that input. 

400

Why is python considered a high level programing language? 

It "easily" understood by programmers, but it needs to be translated down to Binary in order for computers to understand.  

400

What would the following code do?

player.y = player.y - 2 

It would move the player towards the top of the screen 

400

What is the newest wood type in Minecraft?

Bamboo

500

What does the following python code do?

list = [0,2,4,6,8]

for i in range(0, len(list))

   list[i] = list[i] + 2

Loops through each index of the list and at each index of the list it adds 2 to the number that is in that position so each item will be 2 greater.

list will now equal [2,4,6,8,10]


500

How many times does the update loop run a second?

60

500

What is this binary number in decimal? 

1011 (Hint binary is a 2 based system) 

1011 = 11 

2^3 +0 + 2^2 + 2^0 

8+0+2+1 = 11

500

How do tell if two items intersect?

Use the colliderect function 

500

What is gravy?

A fruit!