The Python process controls the IF branch statement for Loop statement while the Loop statement break and the Continue loop control the 1.if branch statement if single branch statement:
Format:
if conditional Expressions: Directives Else : Instruction
For example:
A = 1if a = = 1 :print("Yes")else : Print ("No")
------------The result of the output-----------
Yes
If multi-branch statement:
Format:
if conditional expression: directive elif conditional expression: directive elif conditional expression: directive else : directives
For example:
A = 1= 2if a! = 1 :print("A! = 1")elif b = = 2 :print("b = = 2")Else : Print ("No")
-----------The result of the output---------
b = = 2
If nested formula sentence:
Format:
if conditional expression: directive if condition expression: directive else : directive Else : instruction
For example:
A = 1b= 2ifA = = 1 : Print("a=1") ifb! = 2 : Print("b! = 2") Else : Print("b=2")Else : Print("a!=1")
------------The result of the output-----------
A=1
b=2
Python Development-Process Control