Syntax
Conditionals
Loops
Functions
MISC
100

what is wrong with this code?

print("hello world')

mismatched quotation marks

100
what is wrong with this code

if x = 10:

   print("x is 10")

elif x < 10:

   print("less than 10")

else:

   print("greater than 10")

no double equal

100

write a for loop that counts from 1 to 10 by 3s.

for i in range(1,11,3):

    print(i)

100
what is the keyword I need to start all my functions with?

def

100
sports = ["baseball", "soccer", "football", "basketball"]


how do I change "football" to "swimming"?

sports[2] = "swimming"

200

When do I need to indent a line of code?

After a colon when we are trying to represent that a piece of code is inside another piece of code

200

How many elifs can I have after 1 if statement?

as many as you want

200

what is the difference between a for loop and a while loop?

For loop is used when the number of iterations is already known. While loop is used when the number of iterations is unknown. (Other answers are acceptable as well)

200

how many parameters can you have in a function?

unlimited 
200
letters = ["a","b","c","d","e","f"]


how do I add z to the list?

letters.append("z")

300

what is wrong with this code? Name 3 things

num = 3

if num != 5

print("not equal!")

   else:

      print("equal!")


no colon after if, no indentation of print("not equal!") and the else is indented under the if

300

Do I always have to have an else statement after an if/elif statement?

No

300

What is the output of this loop?

i=10

while 7 * 3 >= 21:

   print(i)

   i-=1

infinite loop

300

what will print when I run this program?

def sum(a,b):

   print(a + b)

nothing. the function was never called

300

what is the error that will appear when I run this code? (as close to actual error as possible)

num = input("Enter a number to add to 3: ")

sum = num + 3

print(sum)

can only concatenate str (not "int") to str

400

what is the error in this code and how would i fix it?

num = int(input("enter a number: "))

print(num + " is the number you chose!")

cannot concatenate ints and strings must use str() around num to use plus sign with it

400

list 6 Python operators (partial credit is possible)

<, <=, >, >=, ==, !=

400

output?

x = 50

while x > 5:

    print(x)

    x /= 2

50

25.0

12.5

6.25

400

name the three parts of a function

function header, function body, and function call

400

What are three rules to naming variables?

no python keywords, can't start with numbers or symbols, cannot have spaces in the name

500

def max(a, b)

   If a > b:

       print("a is greater!'}

   else a < b

   print("b is greater")

no colon after def, mismatched quotations, mismatched brackets, no condition for else, no colon after else, print is not under else, no function call

500

write a program using conditionals that checks if a number is even.

num = int(input("enter a num: "))

if num % 2 == 0:

    print("even")

else:

    print("odd")

500

What is the output?

food = ["apple","grape","cookie","bread"]

for i in range(0,4):

   print(food[i] + ",")

apple,

grape,

cookie,

bread,

500

What is the difference between parameters and arguments?

A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that is sent to the function when it is called.


500

name as many of your classmates (on other teams) and what they like to do as you can. points will be awarded based on how many you can get correct. 

points will be awarded based on how many you get correct
M
e
n
u