Python Variable name sentiment

Source: Internet
Author: User

What I'm feeling is that Python's variable name can actually be understood as a pointer in C + +!

1. A python variable must be assigned before it is used, just as the pointer cannot be empty before it is used. 2, Python memory can be released with Del, C + + can be released with delete. Python:del temp #表示temp所 "Paste to" memory is released, when the TEMP variable is equal to not being assigned (no corresponding memory space), it can not be used. C + +: Delete temp; Releasing the pointer is actually releasing the memory that the pointer points to by the pointer.

A Python variable can be understood as a pointer or a label, and when a note is associated with a piece of memory, the action on the note is the action on that block of memory. The way to associate memory with a tag is the "=" assignment statement

The difference is that the required pointer types must match in C + +. and the tags in Python can be pasted.

Python Variable name sentiment

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.