This often used statement checks the validity of a statement before deciding to do something
What is an 'if' statement?
This variable type stores whole numbers.
What is an integer?
This flow control statement loops through a set of statements if a boolean statement continues to evaluate to True.
What is a while loop?
This commonly used Python data structure contains a collection of items referenced by an index.
What is a list?
Identify the letter printed from these lines of code:
words = "GIS Rules!"
print(words[4])
What is 'R'?
The result of 9 / 5
What is 1.8?
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
What is 2400?
If you are checking whether two things are equal, what do you use?
What is ==?
Identify the letters printed from these lines of code: w
words = "GIS Rules!"
print(words[-1])
What is 's'?
This type of operators allow you to string together tests in an 'if' statement.
What is a Boolean operator? (&& is and, || is or)
If your code is missing a colon or parentheses, what type of error will you get?
What is a syntax error?
What happens if you add a string and an integer?
1 + "hello" = ???
What is a TypeError?
The following Python code loops forever. What is it missing?
n = 10
while n<100:
print(n)
What is a increment statement?
This built-in Python function returns the length of many objects, including Lists.
What is len()?
word = "summer"
print out the word summer like "s u m m e r " using a loop.
What is
answer = ""
for character in word:
answer += character + " "
print(answer)