Python Syntax Review Flashcards
del
deletes objects, i.e. from lists or dictionaries
global
takes an object declared outside a function and uses it within that function
assert
figures out if a certain criteria is met, and if it is not, prints an AssertionError
pass
passes the code from the current iteration of a for-loop to the code following it within the loop
continue
sends a for-loop to the next iteration without executing the code that follows it within the loop
yield
maintains the status of a function while returning a value in that state of the function
break
stops a loop from continuing to run
class
used to create a new object class
exec
executes a string of text as code
raise
raises an exception
finally
at the end of a try block, runs code no matter which branch of the block was followed
lambda
used to establish a one-off function anonymously
%d
decimal format
%i
integer format
%o
octal format