True / False
What is a Boolean?
The output of:
print(5 ** 2)
What is 25?
int("ERROR")
What is illegal integer conversion?
# What am I?
What is a single line comment?
x1 = "The"
x2 = "Ottawa"
x3 = "Senators"
x4 = "will"
x5 = "win."
print( x1 + x2 + x3 + x4 + x5)
What is string concatenation?
print( "A straw has ", 1, " hole.")
What is 'A straw has 1 hole'?
"room = "Tory234"
What is invalid variable name?
The command to the previous folder.
What is cd ..?
>>> var = 2.3
>>> type (var)
What is a float?
xyz = "Hello there!"
What is variable assignment?
Evaluate the following:
number = 32.45489
print(int(number))
What is 32?
var1 = y * 3
y = 2
What is y is undefined for var1?
The output in interactive mode of:
>>> year = input("Please enter the year: ")
Please enter the year: 2022
>>>year
What is '2022'?
What is case-sensitive?
""" This function takes in two integers as input, the length and width, and outputs the area as an integer."""
What is a docstring?
print (2 ++ 2)
What is 4?
print ("My student number is " + 123456789)
What is cannot concatenate strings and integers?
This line in interactive mode is entered:
>>> y = 009
What is an error due to leading zeroes?
The 3 types of errors.
What is syntax, run-time, semantic/logic?
whatIsASandwich vs. what_is_a_sandwich
What is camel case and snake case?
equation = pow ( (23 % 21), abs(11 // 3) )
print(equation)
What is 8?
print( 6 * 3 // 1 - 2 )
outputs: -18
What is a missing pair of brackets around the 1 - 2?
What is the output?
>>> n = 33
>>> m = 55
>>> n = 21
>>> m = m +1
>>> n + m
What is 87?
character, NoneType
What is not primitive types in Python?