Calculation between different variables
Use... Between string variables + String concatenation
for example :first1name=“ 3、 ... and ”
last2name=“ Zhang ”
first1name+last2name=“ Three sheets ”
String variables can be used with integers * Repeat concatenation of identical strings
for example :“-”*5
Output :“-----”
Be careful : No other calculations can be performed between numeric variables and strings .
identifier :1、 Identifiers are made up of letters 、 Underline and numbers make up .
2、 Cannot start with a number .
3、 Cannot have the same name as the keyword .
Variable naming rule
Be careful :python Identifiers are case sensitive
Hump nomenclature
When the variable name consists of two or more words , Use the hump nomenclature
Little hump style :
The first word begins with lowercase , The second word begins with a capital letter , for example :firstName.
Big hump :
The first letter of every word is capitalized , for example :FirstName.
Judgment statement -if sentence
Be careful :if The following four spaces are a if sentence .
Operator :
else:
Logical operations :
elif:
Be careful :elif and else Want to be with if Continuous use , Not to be used alone .