Basic Math
Variables
Flow Control
General Python
A Mix
100
This character denotes the division operator.
What is the forward slash (/) ?
100
This common variable type stores letters, numbers, and symbols.
What is a string?
100
This often used statement checks the validity of a statement before creating a branch.
What is an 'if' statement?
100
To comment a line in Python, you use this/these character(s).
What is a pound sign (#) ?
100
When printing a string you use this to embed the variable
What is %s?
200
These characters have the highest order of operation in Python.
What are parenthesis?
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.
What is a for or while loop?
200
This commonly used Python data structure contains a collection of items referenced by a numeric index.
What is a list?
200
Identify the letter printed from these lines of code: words = "GIS Rules!" print words[4]
What is 'R'?
300
The result of 9 / 5
What is 1?
300
This function allows user input text to be assigned to a variable.
What is raw_input()?
300
What is the value of 'x' after the following Python code has completed executing?
x = 100
for n in range(1,5):
x = x*n
print x
What is 2400?
300
def findSum(number1,number2): sum = number1 + number 2 return sum This program does not run. What do you need to do to make it run?
What is call the function -- for example findSum(4,5)?
300
In order to use graphics and text in codeskulptor, we import this module.
What is simplegui?
400
To raise the number 5 to the power of 8, you must use the power operator (without importing math). This/These symbol(s) denote the power operator.
What are two asterisks (**) ?
400
Data stored as a string is surrounded by these.
What are quotes?
400
sum = 0 for number in range(1,100,1): sum += number print sum What is the value of sum at the end of the program?
What is 5050?
400
This operator puts a list in ascending order.
What is sort()?
400
This operation adds elements to a list.
What is append()?
500
Denoted as '%', this operator returns the remainder of a division operation. What is 129 % 5 = ?
What is 4
500
To determine the variable type of a variable, you would use this function.
What is type()?
500
The following Python code loops forever. What is it missing?
n = 10
while n<100:
print n
What is a increment statement (or n+=1 or n = n + 1)?
500
This built-in Python function returns the length of many objects, including Lists.
What is len()?
500
This operation returns a subset of a list.
What is a slice?