Continue to Practice Python Basics Summary (Comment | variable)

Source: Internet
Author: User

began to formally enter the study of Python First, the comment statement that is greeted: Let 's start by understanding the Python environment variable comment statement:
# !/usr/bin/env python

I'm not talking about anything else. This is a little bit/usr/bin/env. This is your system's default Python environment variable. We know we can install a variety of Python in the system. But many versions of Python are for systems where the system environment variable reads into Python's program, such as when we execute the $ Python aa.py statement, we can see what version of Python the display results are, not that the higher the better, Not that you installed Python3 and python2.6 and then you have to do it with a higher version of the interpreter, but just look at the path. The python environment described by this path is the system environment. The advantage of this writing is that the file can be self-executing if it is given permission to execute the file later. such as $./AA.PYC uses this automatic execution method to automate Python for the system language.

Next is the second annotation language UTF8 encoding:

# -*-coding:utf-8-*-

This is only used in Python version 2 and automatically inherits the Python3 in the code. In fact, there are some more complex things, but this stage is first understood here.

Second, the definition of variables in Python:

A variable is a change of value; The format of a variable is a string that begins with a letter or underscore and contains only numbers, letters, and underscores. Moreover, many of the strings reserved in the system cannot be used as variables, although these reserved variables can still be assigned, but the result of the assignment can lead to unpredictable problems. The known system reservation keywords are as follows: "and", "as", assert "," Break "," class "," Continue "," Def "," Del "," Elif "," Else "," except "," exec "," finally " , ' for ', ' from ', ' global ', ' if ', ' import ', ' in ', ' is ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While "," with "," yield "

Here is a detailed explanation of an old boy's senior teacher:

Continue to Practice Python Basics Summary (Comment | variable)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.