Comment input variable variable name rule code block if else;if elif else;pass

# single line comment

"""Multi-line comment

n1 = input('')

n2 = input('')with 

print(n1)

print(n2)

Variable name rules: can only consist of letters, numbers and underscores, and cannot start with a number, and cannot use Python keywords (and as assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass print raise return try while with yield) better not to duplicate what is built into Python

Code block if colon, change a line with four spaces (Tab key)

if else if...then...; else...then... supports nesting

A total of four levels

if level is one, then...

elif level is level two, so...

The elif level is level three, so...

else (otherwise the level is four), then...

From top to bottom, until the conditions are met, output when the conditions are met

pass

if ...

  pass (empty, pass, write nothing)

else 

print

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325028564&siteId=291194637