This operator is used for exponents.
What is **?
This data type stores a sequence of characters.
What is a string?
This statement evaluates a boolean expression and runs a section of code based on if that expression is True or False.
What is an 'if' statement?
To comment a line in Python, you use this character.
What is a pound sign (#) ?
The index of "y" in the string "Python."
What is 1?
What 15%4 equals.
3
This flow control statement loops through a set of statements if a test statement continues to evaluate to True.
What is a while loop?
Identify the letter printed from these lines of code: words = "GIS Rules!"
print (words[4])
What is 'R'?
What x equals in this code.
def myFunction(a, b):
return a**b
x = myFunction(4, 2)
What is 16?
The name of this technique of variable naming:
myListOfBooks
What is camel casing?
This keyword stops your loop immediately.
What is break?
The data type that the input() function returns.
What is a string?
This operator "glues" two strings together.
What is the + sign?
Fill in the operator:
7 ? 2 = 3
What is //?
The value of x in this code.
x = True and False
What is False?
What is the value of 'x' after the following Python code has completed executing?
x = 1
for n in range(1,5):
x = x*n
print (x)
What is 24?
How many times this loop repeats.
for x in range(1, 10, 2):
print("hello")
5
Identify the letters printed from these lines of code:
myString = "hello".capitalize()
print(myString)
What is "Hello"?
Explain what would be added to this program so that it works as intended.
def addition(a, b):
x = a+b
print(addition(1,2))
What is a return statement?
To determine the variable type of a variable, you would use this function.
What is type()?
The following Python code loops forever. What is it missing?
n = 10
while n<100:
print(n)
What is an increment statement? (n = n + 1)
This built-in Python function returns the length of many objects (ex: lists and strings).
What is len()?
myString = "hello"
The code to set myString equal to "HELLO" using string methods.
myString = myString.upper()