This character denotes the division operator.
What is the forward slash (/) ?
This common variable type stores letters, numbers, and symbols.
What is a string?
This often-used statement checks the validity of a statement before creating a branch.
What is an 'if' statement?
These characters have the highest order of operation in Python.
What are parenthesis?
This variable type stores decimal numbers.
What is a float?
This flow control statement loops through a set of statements.
What is a for loop?
This commonly used Python data structure contains a collection of items referenced by a numeric index.
What is a list?
Identify the letter printed from these lines of code: words = "GIS Rules!" print words[4]
What is 'R'?
This function allows user input text to be assigned to a variable.
What is input()?
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?
How do you reverse a list in Python?
a = [1, 2, 3, 4, 5]
# Reverse the list in-place
a.reverse()
or
a[::-1]
Identify the letters printed from these lines of code: words = "GIS Rules!" print words[:-1]
What is 'GIS Rules'?
To raise the number 5 to the power of 8, you must use the power operator. This/These symbol(s) denote the power operator.
What are two asterisks (**) ?
Data stored as a string is surrounded by these.
What are quotes?
What is a :?
How do we convert another data type into a String?
What is a str()?
if b = "Hello, World!" and I only want to print "Hello", how would I do it?
Denoted as '%', this operator returns the remainder of a division operation.
What is the modulus?
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?
It's missing, the following inside the while-loop:
n+=10
This built-in Python function returns the length of many objects, including Lists.
What is len()?
What is the difference between = and == mean?
= means an assignment
== means comparing two values