Data Types
Loops
Lists and Strings
PiTops
Functions
100

What is an integer? 

A whole number

100

What is a for loop? 

In computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly.

100

What is a String variable? 

String variables may contain letters, numbers and other characters.

100

What is a computer? 

Any machine that can carry out a set of algorithms and arithmetic instructions. 

100

What is a function? 

In programming, a named section of a program that performs a specific task. In this sense, a function is a type of procedure or routine.

200

What is the difference between a Double and an Integer? 

A double can be a decimal number, while integers have to be whole numbers. 

200

What is a While loop? 

A while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement.

200

fruits = ["apples", "grapes", "banana"] 


what does print(fruits[1]) print out? 

It prints out grapes. 

200

What is the motherboard in a Pitop called? 

A Raspberry Pi! 

200

How do you declare a function? 

Use the words def! 

300

Name and explain all four types of variables that we learned about in class. 

Boolean, string, integer, double. 

300

What does the following Code do? 

For i in range(0,10): 

print("Hello Monkeys") 




prints Hello Monkeys 10 times 

300

How do you get the last item in a list? 

pop()

300

What does the following function do? 

def sayHi(name): 

print("Hi" + name) 

prints Hi and whatever name is inputed. 

400

What is wrong with the following code? 

print("hi I am" years + "old") 

forgot a + sign. 

400

What does the following code do? 

keep_going = True 

while keep_going: 

walkTowardsDragon()

walks towards the dragon infinitely until met with ultimate death. 

500

What is wrong with the following code? 


guessed = True 

 while not guessed:

    guess = input("Pick a number")

    if int(guess) == 14:

        guessed = True

 print("You win!")

The while loop never executes because it is initially set to True. 

M
e
n
u