Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 12

del is used to delete objects.

In Python everything is an object,


so the del keyword can also be
used to delete variables, lists, or
parts of a list etc.
A class is a code
template for creating
objects. Objects have
member variables and
have behavior
associated with them
if
It is used for
decision-making
operations. It contains a
body of code which runs
only when the condition
given in the statement is
true.
An else statement is an
alternative statement
that is executed if the result
of a previous test condition
evaluates to false.
Importing refers to allowing
a Python file or
a Python module to access the
script from another Python file
or module. You can only use
functions and properties your
program can access.
A lambda function is a
small anonymous function.
A lambda function can take
any number of arguments,
but can only have one
expression
none
It is used to define a null
value, or no value at all. It
is not the same as 0, False,
or an empty string.
return
It is used to end the
execution of the
function call and gives
the result to the caller.
yield
It is a keyword that is
used like return, but the
function will return a
generator
try
This block lets you
check some code for
errors.
assert
It is used when debugging code.
It lets you test if a condition in
your code returns True, if not,
the program will raise an Error.
global
It allows you to modify the
variable outside of the
current scope.

You might also like