Basics
Data Types
Control Flow
Functions
Advanced
100

This keyword defines a function.

def

100

The type of "Hello".

str

100

The keyword for conditional branching.

if

100

What is the purpose of a function?

A function is used to organize reusable blocks of code.

100

The keyword for defining a class.

class

200

The symbol used for comments.

#

200

The type of [1,2,3].

list

200

The keyword to exit a loop early.

break

200

The keyword for anonymous functions.

lambda

200

The method called when an object is created.

__init__()

300

The output of print(type(3.14)).

<class 'float'>

300

The immutable sequence type.

Tuple

300

The keyword to skip to next iteration.

continue

300

The term for arguments with default values.

default arguments

300

The operator for floor division.

//

400

The keyword for loops over sequences.

for

400

The difference between set() and {}.

set() creates an empty set

{} creates an empty dictionary

400

The operator for logical AND.

and

400

The keyword to import functions from modules.

from

400

The keyword used for generator

yield

500

The default return value of a function with no return.

None

500

The type returned by len("abc").

int

500

The keyword for handling exceptions.

try

500

what is the scope rule which python uses?

L → Local
E → Enclosing
G → Global
B → Built-in

500

The decorator used for class methods.

@classmethod