Python variable,

Source: Internet
Author: User

Python variable,

Python variable

It is very easy to define variables in python, for example, the following code:

Name = "admin"; print (name );

The above is to define a basic variable. Here we will talk about some other things about the variable. Please take a look at the code.

Name = "admin"; name2 = namename = "aaa"; print (name, name2)

Here, the output of name is aaa, and the output of name2 is admin. What we want to talk about here is that when name2 = name is in the memory, it does not point to name, but directly to admin, therefore, when the name value is re-assigned, the value of name2 will not change.

A constant:

Pie= "3.1415926 ";

 

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.