Comments
Single line: #
Multiple lines: 3 consecutive single or double quotes on top and bottom
3 Quotes In addition to multiple lines of comment, you can also print more than one line
Example:
msg = name = (name) (msg)
Running the result the second print is printing 3 lines of string.
If a single line, use quotation marks: msg = "Alex Li"
In Python, single and double quotes are the same, except for single sets of double or double sets.
Example: Msg = "I ' m Alex Li"
User input
Example:
= () password = () (, password)
Formatted output
%s (string), the difference between%d,%f
Print the data type of the variable: print (type (variable name))
RAW_INTPU Python 2.x
Input Python 3.x
Python2, it is recommended to use the Raw_input, if you use input, you need to enter the value of the string variable when the "" quote.
Classroom Exercises:
This article is from the "Tread Footprints" blog, please be sure to keep this source http://zoucuo.blog.51cto.com/962798/1885563
Python Learning note 10 (User interaction Program)