This character denotes the division operator.
What is the forward slash (/) ?
This function allows the user to type in their answer.
What is a input()
This often used after an if-statement but before an else.
What is an elif-statment?
This conditional statement repeats through a set of statements until the condition is no longer true.
What is a while loop?
This operator "glues" two strings together.
What is a comma? ,
These characters have the highest order of operation in both Maths and Python.
What are parenthesis or brackets ()?
What is a colon? :
A loop that repeats forever is called this.
What is an infinite loop?
To comment a line in Python, you use this/these character(s).
What is a hashtag or pound sign (#)?
The result of 9 // 5
What is 1?
Data stored as a string is surrounded by these.
What are quotation marks or speech marks?
Below is a piece of sample code. Assume name has already been defined at that there is an else-statement later.
if name == "Mr. Aravind":
print("Hi, Mr. Aravind!")
Find the error.
What is a missing indentation in the second line?
Write the output of the code below.
n = 1
while n<6:
print(n)
n = n+1
What is
1
2
3
4
5
A named piece of computer memory.
What is a variable?
To raise the number 5 to the power of 8, you must use the power operator. This/These symbol(s) denote the power or exponent operator.
What are two asterisks (**) ?
This common variable type stores letters, numbers, and symbols. It is the data type found between quotation marks in a print statement.
What is a string?
Elif is short for this.
What is else if?
The code below does not give an output. Find the error.
n = ""
while n == "yes":
print("hello!")
n = input("Would you like to say hello again? ")
What is the first line should say n = "yes" ?
This code won't give an output because it never enters the loop.
Find the output of the code below:
a = 4.5678
rounded_a = round(a, 2)
print(rounded_a)
What is 4.57?
You are writing a code that will output the generation the user was born in using their birth year.
birth_year = input("What year were you born in? ")
Find the error.
What is missing int() around the input statement?
What are if-statements within if-statements?
The following Python code loops forever. What is it missing?
n = 10
while n<20:
print(n)
What is an increment statement? Or what is n = n+1 or something similar.
The difference between = and == is this and give an example of when you would use each.
What is... = assigns a value and == compares values?
Ex.
name = input("What is your name? ")
if name == "Alina":