Lists in Python
Variables
Flow Control
General Python
String Operations
100

How would you create a blank list and save to variable called myList?

myList = []

100
This common variable type stores letters, numbers, and symbols.
What is a string?
100

This often used statement checks whether a statement is true or false before making a decision.

What is an 'if' statement?

100

To comment a line in Python, you use this/these character(s).

What is # ?

100
This operator "glues" two strings together.
What is the concatenation (+) operator?
200

How would you create a list from the variable word if it contained a string?

myList = list(word)

200
This variable type stores decimal numbers.
What is a float?
200

This flow control statement loops through a set of statements if a test statement continues to evaluate to True, this may continue for an unknown number of times.

What is a while loop?

200

What is 7%9?

7

200

Identify the letter printed from these lines of code: words = "GIS Rules!" print words[4]

What is 'R'?

300

What is the result of this code?

myList = [12,6,5]

myList.append(4)

myList.insert(2,3)

print(myList)

[12, 6, 3, 5, 4]

300

How would you get a float number inputted from the user and save to variable num?

num = float(input("Please give me a decimal number"))

300

What is the value of 'x' after the following Python code has completed executing, what is the last value of x printed?

x = 100

for n in range(1,5):

x = x*n 

print (x)

What is 2400?

300

What the output of this code?

number = 15

number * 12

print(number)

15

300

Identify the letters printed from these lines of code: words = "GIS Rules!" print words[:5]

What is 'GIS R'?

400

What code would compare the 3rd item in myList to every other item to determine if it was equal and print true every time it was equal?

for x in myList:

     if x == myList[2]:

            print(true)

400

Does all the data in a list have to be of the same type?

No

400

What is output when the following code is run?

n = 0
while n > 0:
     n -= 1
     print(n)

Nothing the loop never executes

400

What does the following code do?

x = 9

y = 7

temp = x

x = y

y = temp

Switches the values of x and y 

400

What does the following code output?

word = "funny"

for x in range(len(word)):

    print(word[x]) 

f

u

n

n

y

500

What does the following code output?

myList = [9,7,2,6,5,1]

for x in range(len(myList)):

      if myList[x]%2 == 1:

           print(x)


0

1

4

5

500
To determine the variable type of a variable, you would use this function.
What is type()?
500

This code has an error.  What is it missing?

n = 10

while n<100:

      print (n)

What is a increment statement.  n doesn't change inside the while loop

500

This built-in Python function returns the length of many objects, including Strings.

What is len()?

500

Given the following code 

name = input("Give me your name")

How would you print out the last letter of the name?

print(name[len(name)-1])

M
e
n
u