This character denotes the division operator.
The forward-slash (/)
This common variable type stores letters, numbers, and symbols.
A string
This statement checks the validity of a statement before creating a branch.
if statement
The two types of loops in Python.
For & while loops
These characters have the highest Order of Operation in Python.
Parenthesis
This variable type stores decimal numbers.
A float
This boolean operator checks if the value on the left is greater than the value on the right.
>
This is a type of loop that never stops iterating.
infinite loop
The result of 9 / 5
1
Data stored as a string is surrounded by these. Note: It doesn't have to have parentheses around them if it is not being used in a function so the answer isn't parentheses.
Quotes
(Additional 25 seconds on the clock)
What is the value of 'x' after the following Python code has completed executing?
x = 50
for n in range(1,5):
x = x*n
print(x)
2,400
These characters MUST be put at the end of every function call. Not referring to the colon which follows these characters when you are first defining and creating the function.
A parentheses
To raise the number 5 to the power of 8, you must use the power operator. This/These symbol(s) denotes the power operator.
Two asterisks (**) or (^)
(Additional 25 seconds on the clock)
What is the output of the following program:
Time = 20
if Time>30:
Time=Time+Time%3
Time=Time/3
print (Time)
else:
Time= Time%2-(Time/2)
print (Time)
-10.0
The following Python code loops forever. What is it missing?
n = 10
while n<100:
print n
an increment statement or n++
(Additional 25 seconds on the clock)
What is the output of the following program:
for i in range (1,11,3):
if i % 2==0:
print (i)
4
10
Denoted as '%', this operator returns the remainder of a division operation.
Modulus or Mod Operator or Mod
(Additional 15 seconds on the clock)
How can we swap the values of two variables (A & B) using a temp variable?
Complete the set up:
temp = ______
____ = ______
_____ = temp
temp=A
A=B
B= temp
What is the output of the following program:
y=30.0
if (y%5 != y%3):
y=y/7
else:
y= y**2
print (y)
900.0
(Additional 25 seconds on the clock)
What will be displayed as a result of running the program below:
#the following function oddOrEven is defined below
def oddOrEven(x):
if x%2==0:
print ("Odd")
else:
print ("Even")
#for loop using the range function print out results
#because of the called oddOrEven() function
for i in range (1,11,3):
oddOrEven(i)
Even
Odd
Even
Odd