Python base syntax and C, Java diff points

Source: Internet
Author: User

Python syntax is similar to C, Java, where the python base points are different from C, Java, and so on.

1. Identifiers that begin with an underscore are of special significance, with a single underline, a class attribute that is not directly accessible by a representative of _f must be accessed through the interface provided by the class, and cannot be imported with the From XXX import *; __f that begins with a double underline represents a private member of the class; The _f__ represents the identity of a particular method in Python, such as __init__ (), which represents the constructor of the class.

2, the variable assignment in Python does not require a type declaration, Python has five standard data types: Numbers (numeric) string (string) list (list) Tuple (tuple) Dictionary (dictionary), tuple is not allowed to update, The list is allowed to be updated. 3. The From...import statement Python's from statement lets you import a specified section from the module into the current namespace.


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.