Concise python Tutorial: http://sebug.net/paper/python/index.html
python features: simple, easy to learn, free open source, high-level language, portability, interpretive, object-oriented, extensible, embeddable, Rich library.
Object-oriented: Python supports both process-oriented programming and object-oriented programming.
How to exit the Python prompt: If you are using the Linux/bsd shell, press
ctrl-dExit the prompt, or, if it is in the Windows command, press
ctrl-zThen press
Enter。
Python basic data type: number, the type of number in string Python except for integers, long integers, floating-point numbers, and
plural。 String: Python can use single quotation marks ('), double quotation marks ("), and three quotation marks (" "" or "") to indicate a string. The string is immutable.
Naming of identifiers:Variables are examples of identifiers.
Identifiersis used to mark
some kind of thing.'s name. Follow these rules when naming identifiers:
- The first character of the identifier must be the letter in the alphabet (uppercase or lowercase) or an underscore ('_')
- Other parts of the identifier name can consist of a letter (uppercase or lowercase), an underscore ('_'), or a number (0-9)
- The identifier name is case-sensitive. For example, MyName and myname are not identifiers.
- Examples of valid identifier names are I, __my_name, name_23, and A1B2_C3
- Examples of invalid identifier names are 2things, this was spaced out, and my-name
The Ps:python Identifier naming convention is the same as the naming convention for Java identifiers.
python only needs to assign a value to them when using variables. You do not need to declare or define a data type.
Physical and logical lines: the physical line is the one you are writing the program
SeeOf Logical line is Python
SeeThe single statement. Python assumes that each
Physical LineCorresponds to a
Logical Line。
Backslashes can be used as explicit row connections.
python syntax: Force indentation.
"Python Introduction and basic Concepts"