Terminology
Lists
Conditional Statements
Basic Syntax
Misc.
100
What is a variable?

A value that can be stored by a variable name and referenced later

100

What is a list in Python

an ordered collection of items

100

What keyword is used to create a basic if statement in Python

if

100

How do you check if a value or variable is equal to another

==

100

State at least three math operators in Python

+ , - , / , * , ** , %... etc

200

What is an if statement

It checks if something is true. if it is, it runs what is inside

200

How do you access the first element of a list named my_list

my_list[0]

200

ow do you write an if statement that checks if a number x is greater than 10?

if x > 10:

200

What is the correct way to print "Hello, World!" in Python?

print("Hello, World!")

200

What is the purpose of input() in Python?

to receive input from the user

300

What is a function?

a reusable block of code that performs a specific task

300

What are stored inside lists?

Elements

300

if 5 > 10:  
     print("Yes")
else:    
     print("No")

what will this return?

No

300

How do you define a variable called my_var with the value 10?

my_var = 10

300

What does the len() function do?

it returns the number of elements in an object (like a list or string)

400

What is the formal name of the inputs passed to a function?

Parameters

400

How do you add an element to the end of a list?

my_list.append(item)

400

What is the purpose of the else statement in Python?

to define a block of code that runs when all other conditions are false

400

What do you use to define a function in Python?

def 

400

How do you convert a string "123" to an integer in Python?

int("123")

500

What is the random function to randomly select an element from a list?

random.choice or choice
500

How do you remove the 5th element of a list called x

x.remove(4)

500

Identify one error in the code below

if 6 + 1 = 7;

    print("Hi guys")

else;

    print("Goodbye guys"(


Either the semicolons after the if statements, or the if 6 + 1 = 7 only having one equal sign instead of two.

500

Explain what 2 of the 3 following operators do

>= , == , !=

Check if a value is more than or equal to, if it is equal to, or not equal to

500

How could you get the last element of a list?

my_list = [2, 4, 7]

my_list[len(my_list) - 1]