This keyword defines a function.
def
The type of "Hello".
str
The keyword for conditional branching.
if
What is the purpose of a function?
A function is used to organize reusable blocks of code.
The keyword for defining a class.
class
The symbol used for comments.
#
The type of [1,2,3].
list
The keyword to exit a loop early.
break
The keyword for anonymous functions.
lambda
The method called when an object is created.
__init__()
The output of print(type(3.14)).
<class 'float'>
The immutable sequence type.
Tuple
The keyword to skip to next iteration.
continue
The term for arguments with default values.
default arguments
The operator for floor division.
//
The keyword for loops over sequences.
for
The difference between set() and {}.
set() creates an empty set
{} creates an empty dictionary
The operator for logical AND.
and
The keyword to import functions from modules.
from
The keyword used for generator
yield
The default return value of a function with no return.
None
The type returned by len("abc").
int
The keyword for handling exceptions.
try
what is the scope rule which python uses?
L → Local
E → Enclosing
G → Global
B → Built-in
The decorator used for class methods.
@classmethod