Python basic series-(1) Python introduction and primary understanding

00_Python introduction
Advantages of Python

1. Logic, simple grammar, easy to learn, adapt to a wide range of people.

2. Free and open source (that is, open source, you can also maintain Python for the Python version)

3. Wide range of applications. It can do automated operation and maintenance, automated testing, web development, web crawling, data analysis, artificial intelligence, and machine learning.

The following well-known frameworks are all developed in Python language:

  1. Google open source machine learning framework: TensorFlow
  2. The main open source community promotes learning framework: Scikit-learn
  3. Baidu open source deep learning framework: Paddle

The development history of Python: http://baike.baidu.com/item/Python/407313?fr=aladin

Tools: Anaconda, pycharm and python3.7 are used together

01_Elementary understanding

1.1 Notes

The role of comments: Explain the code in a language familiar to humans to facilitate later maintenance.

Classification of notes:

Single line: #Comment content, shortcut key ctrl+/

Multiple lines: "" "Comment content" "" or ""Comment content"'

Note: The interpreter does not perform interpretation

1.2 Variables

(1) The role of variables:

In the program, the data is temporarily stored in the memory. In order to find or use this data more quickly, we usually define a name after storing the data. This name is a variable.

A variable is just the name of the memory address where the current data is located when storing data.

(2) Define variables:

Variable name = value

The variable name is self-defining, to satisfy the identifier naming rules.

The identifier naming rule is a unified specification when defining various names in Python, as follows:

  • It is composed of numbers, letters, and underscores.
  • The number cannot start.
  • You cannot use built-in keywords.
  • Strictly case sensitive.

(3) Naming convention:

  • See the name
  • Big hump: the first letter of each word is capitalized, for example: MyName
  • Little hump: capitalize the first letter of the second and subsequent words, for example: myName
  • Underscore: e.g. my_Name

(4) Use variables:

E.g:

my_name = ‘TOM’

print(my_name)

schoolName ='Lanzhou University'

print(schoolName)

Define the variable, and then call the variable. Variables are executed in order and output results. Accidental indentation will also cause an error, press the top one.

1.3 Debug tool

Debug tool is a tool integrated in PycharmIDE to debug programs, where programmers can view the execution details and procedures of the program or debug bugs.

Steps for usage:

  1. Break point

Breakpoint position—the first line of code of the code block to be debugged by the target is enough, that is, a breakpoint is enough.

Breakpoint method—click the blank position to the right of the line number of the target code.

  1. Debug debugging

Guess you like

Origin blog.csdn.net/qq_46009608/article/details/108912524