First create a. py file
Write code in three ways:
Terminal CD desktop Python file path. py;
Terminal Python enter write code;
In the Pycharm;
Order of execution of the program: from top to bottom, from left to right
The place where the program runs results is generally called the console
In Python, the output statement is printed in print (), and only the numbers, characters and letters, and special symbols must be placed in double or single quotation marks (this does not tangle, single and double quotes are not affected), the contents of the quotation marks are output in the console as is.
Input statements are expressed in input () to obtain what the user has entered in the console
Note: The data obtained by input () is a string
Comments can help us to read the code more quickly when we write the code, so it's a good habit to develop annotations.
The role of annotations:
1, comments on your code;
2. Troubleshooting
Note: The contents of the comment are not performed
Single-line comment: Shortcut key ctrl+/(you can also select multiple lines of comment)
Multi-line Comment (block comment, document comment): "Content of the comment" or "" "Comment" "
The first Python program