Variables and Data Types
Python Basics
Vocab
Loops
Functions
100

How do you create a variable named age with the value 25?

age = 25

100

What is the symbol used to assign a value to a variable?

=

100

What is the term for data that can be changed in Python?

Variable 

100

What keyword is used to start a loop that repeats a block of code a certain number of times?

for
100

What keyword do you use to define a function?

def

200

How do you create a variable 'name' that holds the text "Alice"?

name = "Alice"

200

How do you print a message to the console?

print('message')

200

What is the term for a value that does not change?

Constant

200

How do you write a loop that runs 5 times?

for i in range(5)

200

When naming a function will the name be case sensitive? T or F

T

300

What symbol(s) is used to perform an exponent?

**

300

What function is used to get user input as text?

input()

300

What do you call a sequence of characters like "hello"?

string

300

What is the output of 

for i in range(3): 

      print(i)

0 1 2

300

How do you call a function defined as

def main():

main()

400

What data type(s) is used for numbers in Python?

float and int

400

What will the output be when the following code runs:

print(5+'5')


TypeError

400

What is the term for a block of code that performs a specific task?

Function

400

What is the FINAL output of 

for i in range(3): 

     print(i*i)?

4

400

What will be the output of the function 

def say_hello(): 

       print("Hello")

say_hello() 

"Hello"

500

What is the data type of the value "hello"?

string

500

What symbol(s) are used to make a comment

# or """

500

What is the area of the IED called that shows feedback from your code?

Terminal or Console

500

What keyword is used to stop a loop?

break

500

How do you call a function named my_function?

my_function()

M
e
n
u