Introduction and Getting Started with Python
· Python is a scripting language that combines interpretation, sexual compilation, interactivity, and multiple object-oriented features. For beginners in programming,Python is easy to read and learn, and supports a wide range of application development with a broad base database that supports multiple platforms.
· Install Python in the In the Windows environment
1. go to Python 's official website:https://www.python.org/
2. Click downloads==> Downloads for windows==> Python 3.6.2
3. download the installation file and tick 'Add python 3.6 to path '. ' and select the installation directory to install .
· The first sentence of Python:
Create a new text document on the desktop, change the file suffix name to. PY and Create a new Python file.
Right-click Python files can be edited by selecting ' Edit with IDLE 3.6 '.
Press The current code can be F5 by a test run. The results of the operation are as follows:
· Notes
There are two types of comments in Python: single-line comment ==> at the beginning of the line and # Multiline Comment ==> in the comment content "
· Variables
Naming rules for variables:
1. A variable can only be a combination of letters, numbers, and underscores
2. The first character of a variable cannot be a number, only a letter or an underscore.
3. Keywords cannot be named as variables:
[' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' F ' Rom ', ' Global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' try ', ' while ', ' WI Th ', ' yield ']
• Enter a variable assigned to the user's input
in the In Python 3.0, theinput function defaults to str, and you need to use the INT function if you need to enter a number type character .
Introduction and Getting Started with Python