Surprise Me!
Syntax
Functions
If Statement
Loops
Surprise Me!
100

Recite the first 8 numbers of the Fibonacci Sequence!

0, 1, 1, 2, 3, 5, 8, 13

100

You know the code is part of the if/while/for loop if the code is ________.

Indented

100
What function returns the length of a variable?

len()

100

What is the correct order these statements should go in?

elif, else, if

if, elif, else

100

Is this code valid?

for potato in "potato":

    print(potato)


Yes
100

What is # used for in python?

to write comments


200

Name the four simple data types.

int, float, String, boolean

200

What is the syntax to create a list?

list_name = []

200

Add programmer to this list....

careers = ["doctor", "teacher", "accountant"] 

careers.append("programmer")

200

Which of the following does not have a Boolean expression: for, while, if

for 


200

for i in range (100):

       print (i)


would print the numbers from ___ to ____ inclusive. 

0 to 99

200

If you convert a float (5.6) to an integer, what number will that integer be?

5

300

What does this print?

print("3" * 3)

333

300

What is a python data type that represents numbers with decimal points?

float

300

How would you convert a variable, n, to an integer?

int(n)

300

What does this code print?

if (10 > 5):      

    print("Yay!")

elif (10 > 2):    

    print("booo")

Yay!

300

What type of loop should you use if the number of iterations is unknown.

while

300

DAILY DOUBLE!

Name these symbols!!!

{} [] : ()

Curly Bracket, Bracket, Colon, Parentheses

400

DAILY DOUBLE!

What is the % called?

and

What is 6 % 4?

modulous, 2

400

How many boolean operators are there and what are they?

6: !=, ==, >=, <=, <, > 

400

What data type does the input() function return?

String

400

What does this code print out?

grade = 93.     

if (grade > 93):

    print("A")

else:               

    print("F").   

F

400

What does a nested for loop look like?

for ____

    for ____

400

What does the 'cd' command stand for?

change directory

500

Write a line of code that takes a user input and assigns it to a variable called favorite_food.

favorite_food = input("What is your favorite food?")

500

Find the error in the code:

list1 = ["Mango", "Pineapple", "Pear"]

print(list1[len(list1) / 2])

//

500

What parameter in a print() function can we use to override the print statement's default new line ending?

end=""


500

Is this code valid?

elif (10 > 5):

    print("X") 

else:            

    print("Y") 

NO!

500

What statement allows you exit a loop early?

break

500
What is list1 equal to after running this code?

list1 = [10, 20, 30]

list1[1] = list1[2] + 5

[10, 35, 30]

600

What does this code print?

print("coast"[::2])

cat

600

What is slice notation?

[1:4]

600

What does .lower() do?

-_-

600

True or False:

not (True and False) =

True

600

What does this code print out?

for row in range(6):          

    for col in range(row+1):

        print("*", end ="")    

    print("")                       

*         

**       

***     

****   

***** 

******

600

What does list1 equal after running this code?

list1 = [1, 2, 5, 10]

list1.pop(2)

[1, 2, 10]

M
e
n
u