What is the output of
print(2 + 3 ** 2 - 12)?
What is -1?
This common variable type stores letters, numbers, and symbols.
What is a string?
This often used statement checks the validity of a statement before continuing
What is an 'if' statement?
To comment a line in Python, you use this/these character(s).
What is a pound sign (#) ?
When printing a string you use this to embed the variable
What is %s?
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 if a test statement continues to evaluate to True.
What is a for or a while loop?
def addition(number1,number2):
In this example, number1 is an example of?
What is a parameter?
This is an if statement inside another if statement
What is a nested if statement?
The result of 9 / 5
What is 1?
This built in 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?
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)?
This operator checks to see if two items are not equal.
What is !=?
To raise the number 5 to the 8 power, using a Math method, write the code to do this and store the value in the variable number.
What is number = Math.pow(5,8)?
Data stored as a string is surrounded by these.
What are quotes?
sum = 0
for number in range(1,3,1):
sum += number
print sum
What is the value of sum at the end of the program?
What is 3?
This statement is used to both provide a result value for a function, and to go back to the statement immediately following the function call.
What is return?
This operation adds elements to a list.
What is append()?
What is 129 % 5 = ?
What is 4?
To print the output 1,3,5,7,9 what does a and b need to be in the following for loop?
for i in range(1,a,b):
What is 10 and 2?
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)?
This built-in Python function returns the length of a string, amongst other things.
What is len()?
What characters do we use to find a character in a string or a variable in a list
What is square brackets []