One, variable
It can be a letter, a number (not a start), an underscore.
The custom constant name is generally capitalized.
= NA
Print ("My Na is", Na, Na2)
Print ("My Na is", Na, Na2)
The NA2 outputs the same result. Think about why
second, character encoding
ASCII 255 Unicode Unified Code Utf-8
When using Python2, enter #-*-Coding:utf-8-*-before the code: buffer = "Hello" will error
Python3 there will be no problem, default Utf-8
Third, comments
# Single Line " Multi-line Comment "
four, single double quotation mark same
Stitching a string is like adding an operation +
Five, the user inputs input
=input (
Print (name)
Vi. formatted output
Need to use%
Name =input ("name:")
Love =input ("Love:") #python2 is Raw_input
Outt = " '
--------Outputinfo--------
< Span style= "COLOR: #0086b3" > name:%s
< Span style= "COLOR: #0086b3" > < Span style= "COLOR: #dd1144" > love:%s
< Span style= "COLOR: #0086b3" > < Span style= "COLOR: #dd1144" > "% (name, age, Love)
Print (Outt)
%s is a character, similar to the C language. What's the difference between a dollar sign and a fun one?
Print a Type Prinf (type (variable name))
You can convert directly to the variable name by adding the type. such as: Int ()
Python Basic knowledge Note (i)