[python] first understanding of python

Python is a computer programming language. For example, the C language, the very popular Java language, the Basic language suitable for beginners, the JavaScript language suitable for web programming, etc., are all examples of programming languages. Python can do daily tasks, such as automatically backing up your MP3; it can be used as a website, Many famous websites including YouTube are written in Python; they can be used as the backend of online games, and the backends of many online games are developed in Python.

The advantage of python is that it has less code, is concise, and has strong operability. It has less code than C language, but can do more things.

Disadvantages of python: The first disadvantage is that it runs slowly. Because Python is an interpreted language, your code will be translated into machine code that the CPU can understand line by line during execution. It is executed while translating, while the C program is executed before running It is directly compiled into machine code that the CPU can execute, so it is very fast. The second disadvantage is that the code cannot be encrypted. If you're going to distribute your Python program, you're actually distributing the source code

The download of python is to go directly to the official website to download, and then install it directly. The installation process is simple and convenient, but under different operating platforms, you need to download python software for different platforms.

After installation, open the command prompt window directly. You can also press crtl+R, search for cmd, and enter python directly at the command prompt.



If the above situation occurs, the installation is successful.

Just started contact, where the prompt of python is >>>, and the command prompt of the command window is c:/>, similar to this, it is necessary to distinguish clearly, and directly enter any operation about python in the command line mode , are all wrong, the operation can only be completed by first entering python, entering the python interactive mode, and then operating at the prompt of >>>.

After entering exit() in python interactive mode, exit python interaction and return to the command line.

The syntax of python is the same as that of C language and Java language, and it has strict specifications.

In addition to directly entering python to enter python interactive mode, you can also run python files and enter python interactive mode, but when using python files to enter, the output must be output using the print output function, and the interactive mode entered by entering python can be directly output.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325604696&siteId=291194637