Python Learning Note 0

Source: Internet
Author: User

0. The "#" notation indicates that the three quotation marks (either single or double) can also represent comments, and can annotate multiple lines and print multiple lines.

1. The variable name is best used in English that can accurately express its meaning so that others can understand it, avoid using Chinese or single letter.
2. With input whatever you enter, the default is a string type, and if you want to enter an integer you must add an int. You can also enter and then use the built-in function eval to convert. 3. The "/" Backslash is an escape character, and the characters n is escaped to indicate a newline, avoiding the need to escape the character by adding R at the beginning. 4. The "%" percent operator can be used for the remainder of integers or real numbers, or for string formatting, with the same effect as format. 5. The object in the import module takes precedence: from+ module name +import+ object name. The import+ module name is used only if multiple objects in the module are used more than once. This helps increase the speed of your code. 6. It is best not to insert or delete in the middle of the list, to select at the tail, so as not to change the subscript of some elements in the list. 7. Keys in a dictionary can only be immutable data, such as integers, real numbers, complex numbers, strings, tuples, and so on, and cannot be duplicated. A list, collection, dictionary, or other mutable type cannot be a key in a dictionary. 8. The collection can only contain immutable data types, such as numbers, strings, tuples, and so on, and cannot be duplicated, and cannot contain mutable types of data such as lists, dictionaries, collections, and so on, as in dictionary keys. 9. If you need to use the keyword in, you can use the collection or dictionary, do not use the list, because the use of the list is the slowest.

Python Learning Note 0

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.