The so-called understanding, is to really integrate, otherwise stuffed in the brain of knowledge, is also dead.
Preface: This is their own way of learning, through the record notes to arrange ideas, there is no place please more advice ~
Python Basic Syntax
Python is a high-level scripting language that combines explanatory, compiled, interactive, and object-oriented.
Python's design is highly readable, with English keywords often used in other languages, some punctuation in other languages, and it has a more distinctive grammatical structure than other languages.
Yes
Python writes code in a way that acts like a C,c++,java , and that it works the same way:
1 Print (' Hello! Python'); Print ('hello! Python')2'Monday, Tuesday, Sunday'3 print(days)
Run:
Empty line for Python:
A blank line separates between functions or methods of a class, representing the beginning of a new piece of code. The class and function entries are also separated by a line of blank lines to highlight the beginning of the function entry.
Blank lines are different from code indentation, and empty lines are not part of the Python syntax. When you write without inserting a blank line, the Python interpreter runs without errors. However, the purpose of a blank line is to separate the code of two different functions or meanings, which facilitates the maintenance or refactoring of future code.
Remember: Blank lines are also part of program code
Quotation marks for Python:
Python can use ', ', ', ' to represent a string, where ' ' ' can be used as an annotation.
Notes for Python:
Single-line comments can use #, and multiline annotations can use "".
The indentation in Python
The biggest difference between python and other languages is that instead of using {} to control classes, functions, and other logical judgments, Python has the most characteristic of using indentation to write modules.
Note: The amount of whitespace to indent is variable, but all code block statements must contain the same amount of indentation whitespace, which must be strictly enforced.
The above three code shows:
1 test = 12if test:3 print (' I'm da! ')4 print ('KISS me! ' )5Else :6 print (' hehe Hey! ')
Run:
Aqua Wood Confession Studio: Starting from 0 python-Grammar chapter (i)