what is the result of 16 / 5 ?
3.2
What is the value of 'x' after the following Python code has completed executing?
x = 1
for n in range(5):
x = x + 2
11
Where have we used a while loop in our Vampire Pizza Attack code?
In the game loop, using the game_running variable.
Do we play the game with this code?
game_running = False
if game_running:
game()
No
what is the result of 17 % 5 ?
2
What is the value of z after the following code has run?
z = "Animals in the zoo: "
x = 4
for n in range(4):
x +=1
z += str(x)
Animals in the zoo: 8
What type of variable - which only has two possible options - do while loops rely on?
Booleans
What are the two main conditional keywords that we use in code?
If, Else
what is the result of 16 // 5 ?
3
What is the value of the x after the following code has run?
x=0
for i in range(5):
x += i
15
What is the value of x after the following code has run?
x = 3
while x < 8:
x += 2
9
What is the value of 'type' after the following code has run?
x = 5
if x < 10:
x += 10
if x > 10:
x -= 5
10
What is the result of ((2*5)%4)+1?
3
What is the value of 'x' after the following Python code has completed executing?
words = ["Coding ", " Is ", " Fun"]
x = ""
for w in words:
x += w
"Coding Is Fun"
What is the value of x after the following code has run?
x = 3
while x < 8:
x += 2
9
What is the value of 'type' after the following code has run?
x = 15
type = " "
if x % 2 == 0:
type = "even"
else:
type = "odd"
odd
what is the result of (8 % 5) // (11 % 3) ?
1
What is the value of 'x' after the following Python code has completed executing?
x = 10
for n in range(2):
for m in range (3):
x += 2
22
What is the value of x after the following code has run?
x=2
while x<8:
x+=1
while x<4:
x+=1
8
What is the value of x after the following code has run?
x = 0
for n in range(5):
if x < 8:
x += 5
else:
x += 10
40