Keywords in python Flashcards
and
a logical operator
as
used to create an alias/alternative name
assert
used for debugging
break
break out a loop
class
used to define a class
continue
skip the next iteration of a loop
def
it is used to define a function
del
used to delete an object
elif / else
conditional statements
except
try-except is used to handle these errors
false
expression that will result in not being true
finally
used with exceptions
for
create loop
from
import specific parts of a module
global
declare a global variable
if
to create conditional statements
Import
import a module
is
used to test if two variables are equal
in
to check if a value present in a tuple, list etc
lambda
used to create an anonymous function
none
represents a null value
nonlocal
a non-local variable
not
a logical operator
or
logical operator
pass
used when user does not want any code to execute
raise
used to raise exceptions or errors
return
used to end the execution
true
represents an expression that will result in true
try
used to handle errors
while
used in exception handling
yield
create a generator function