Python The reserved word of is the keyword , Is an identifier defined internally by the programming language and reserved for use . These reserved words cannot be used as constants or variables , Or any other identifier name .
and For expression operations , Logic and operation
as For type conversion
assert Assertion , Used to determine whether the value of a variable or conditional expression is true
break Interrupts the execution of loop statements
class Used to define a class
continue Continue with next cycle
def Used to define functions or methods
del Delete the value of a variable or sequence
elif Conditional statements And if else Use a combination of
else Conditional statements Conditional statements , And if,elif Use a combination of . It can also be used for exceptions and recycling
except Including the operation code after catching the exception , And try,finally Use a combination of
exec Used to perform python sentence
for Loop statement
finally For exception statements , After exception , Always carry out finally Contains code blocks . And try,except Use a combination of
from For importing modules , And import Use a combination of
global Define global variables
if Conditional statements , And else,elif Use a combination of
import For importing modules , And from Use a combination of
in Determine whether the variable exists in the sequence
is Determine whether the variable is an instance of a class
lambda Defining anonymous functions
not For expression operations , Logic is not an operation
or For expression operations , Logic or operation
pass Empty class , function , Placeholder for method
print Print statement
raise Exception throw operation
return Used to return calculated results from a function
try Contains statements that may have exceptions , And except,finally Use a combination of
while Loop statement
with simplify Python The sentence of
yield Used to return values from a function in turn