What symbol is used for comments in Python?
#
What is the name of the Python statement that is used to execute a block of code only when a given condition is met?
if
What is the name of the built-in Python function used to display output?
print()
What is a class?
A description of an object.
What is the result of the following code?
print("5 + 3")
5 + 3
What is the name of the data type in Python that is an ordered collection of values, enclosed in square brackets and separated by commas?
list
What is the name of the Python statement that is used to execute a block of code repeatedly as long as a given condition is met?
while
What is the keyword used for declaring a function in Python?
def
What is the name of the special method in Python classes that is automatically called when an object is created?
Constructer Method
or
__init__()
What symbol will multiply 2 numbers in Python?
* or asterisk
What is the name of the data type that represents a Boolean value (True or False) in Python?
bool or Boolean
What is the name of the Python statement that is used to exit a loop prematurely, regardless of the iteration condition?
break
What is the name of the Python keyword used to return a value from a function?
return
When an object is created, you are creating a/an _________ of the class.
instance
What are the 2 numeric types in Python?
integer
float
What Python operator is used to check the equality of 2 strings?
==
What is the name of the Python keyword used to specify a default case in a control flow statement, executed when no other case matches?
else
What is the name of the value that a function returns when no return statement is specified?
None
How do you create an instance or an object of a class in Python?
Call class name followed by parentheses.
What is an IDE? What IDE did we always use?
Integrated Development Environment.
Idle.
What is the name of the Python keyword used to use external modules and files?
import
What is the primary difference between a "for" loop and a "while" loop in Python?
A For loop is used when the number of iterations is predetermined. In contrast, a While loop operates without prior knowledge of iterations.
What is a function called when it is part of a class?
Method
What is the purpose of the __init__ method in Python classes?
Initialize object's attributes.
What is the name of the data type in Python that is an unordered collection of key-value pairs, enclosed in curly braces?
Dictionary