Keywords Flashcards
print to console
print to console
while
while loop
sub routine
returns data types from a list until a specified condition/value is met
controlling the flow of the program with a loop sub routine that will continue forever or till a specified value is met.
preferable to use for loop if poss
while loop
sub routine
returns data types from a list until a specified condition/value is met
controlling the flow of the program with a loop sub routine that will continue forever or till a specified value is met.
preferable to use for loop if poss
while
for
for loop
retuns data types from a list in order
iterate over items of a collection in order that they appear
break
interrupt the (loop) cycle, if needed
yield
is used with generators
exec
executes Python code dynamically
class
used to create new user defined objects
assert
used for debugging purposes
pass
does nothing
del
deletes objects
raise
create a user defined exception
finally
is always executed in the end. Used to clean up resources.
except
catches the exception and executes codes
try
specifies exception handlers
global
access variables defined outside functions
lambda
creates a new anonymous function
return
exits the function and returns a value
def
used to create a new user defined function
from
for importing a specific variable, class or a function from a module
as
if we want to give a module a different alias
import
import other modules into a Python script
or
at least one condition must be met.
and
all conditions in a boolean expression must be met
not
negates a boolean value
is
tests for object identity
else
is optional. The statement after the else keyword is executed,
unless the condition is True
elif
stands for else if.If the first test evaluates to False,
then it continues with the next one
if
used to determine, which statements are going to be executed.
continue
used to interrupt the current cycle, without jumping out of the whole cycle.
New cycle will begin.