Functions
Loops
Data Types
Conditionals
Trivia/Random
100

What is the error with this code?

print("This number is: " + 100)

You cannot concatenate a string with an integer.
100

What are the two types of loops you can make in Python?

for loop and while loop

100

What type is the variable, x?

x = 100

integer

100

Which three keywords in Python can you use for conditionals?

if, elif, else

100

What is the program that we are using to code our projects? 

Bonus: What does IDE stand for?

PyCharm, Integrated Development Environment

200

What keyword do you use before the function name to start defining a function?

def

200

How many times will this loop run?

while True:

  print("Hello")

This loop will not end unless you interrupt it in the console, or the program exceeds the memory limit and crashes.

200

What type is the variable, y?

y = input("Type a number: ")

string

200

What character do you put at the end of a line with a conditional keyword?

A colon

200

What version of Python are we using?

Python 3.10

300

What does the return keyword do in a function?

It exits the function and can return a value to be assigned to a variable.

300

What keyword can you use to exit a loop?

break

300

What is the type of the variable, z?

z = float(input("Type a number: "))

float

300

How many indents do you put for a block of code inside a conditional statement?

One indent (but you can have more depending on the code in the conditional statement like nested conditionals, loops, functions, etc.)

300

What language was Python originally implemented in?

The C programming language

400

What do you call a function that calls itself?

A recurive function

400

How many times will this loop run?

for i in range(3):

    for j in range(5):

            print((i+1) * (j+1))

15 times

400

What is the type of the variable, abc?

abc = (7, 15, 2004)

A tuple (of integers)

400

x = 15                                          

if x % 3 == 0:                                
  print("Divisible by 3")                 
elif x % 5 == 0:                            
    print("Divisible by 5")                
else:                                            
    print("Divisible by both 3 and 5")


"Divisible by 3"

400

What is another type of snake that is also a name for a distribution of Python that includes tools for data science and machine learning, and has package management, deployment, and environment management capabilities?

Anaconda

500

What is the difference between function parameters and arguments in Python?

Parameters are the names listed in the function definition, while arguments are the actual values passed into the function.

def add(a, b):

  return a + b

num = add(10, 5)

500

What keyword can you use to go to the next iteration of a loop instead of executing the rest of the code in the loop?

continue

500

What is one difference between a list and a set?

A set only contains unique elements with no repeats, while lists can contain duplicate elements. Sets are also unordered, whereas lists are ordered and can be indexed by their position in the list. 

500

How many elif statments can you have after an if statement? How many else statements can you have after an if statement?

elif - as many as you want/infinite or none

else - one or none

500

What year was Python invented? (+/- 3 years)

1991