Python – Keywords (more diff.)

 0    23 flashcards    sir
download mp3 print play test yourself
 
Question Answer
To create an alias
start learning
as
For debugging
start learning
assert
To break out of a loop
start learning
break
To define a class
start learning
class
To continue to the next iteration of a loop
start learning
continue
To define a function
start learning
def
To delete an object
start learning
del
Used with exceptions, what to do when an exception occurs
start learning
except
Used with exceptions, a block of code that will be executed no matter if there is an exception or not
start learning
finally
To import specific parts of a module
start learning
from
To declare a global variable
start learning
global
To import a module
start learning
import
To check if a value is present in a list, tuple, etc.
start learning
in
To test if two variables refer to the same memory space.
start learning
is
To create an anonymous function
start learning
lambda
To declare a non-local variable
start learning
nonlocal
A null statement, a statement that will do nothing
start learning
pass
To raise an exception
start learning
raise
To exit a function and return a value
start learning
return
To make a try... except statement
start learning
try
To create a while loop
start learning
while
Used to simplify file handling
start learning
with
To end a function, returns a generator
start learning
yield

You must sign in to write a comment