Python variables and data types, python Variables

Source: Internet
Author: User

Python variables and data types, python Variables
In hexadecimal notation, the prefix 0x and 0-9 a-f are used to indicate that the string is any text enclosed by ''or" ". a boolean value is True and False. or not is a special value in Python, use None. None cannot be understood as 0, because 0 is meaningful, none is a special null print statement that can input the specified text print statement to the screen or start with # To keep up with the comments of multiple strings in python, the subsequent text does not need to be deleted until the end of the line. You can use the comment to temporarily block the equal sign = is a value assignment statement. You can assign any data type to the variable, the same variable can be assigned multiple times and can be of different types. It cannot be equivalent to a mathematical equal sign = string that contains both 'and needs to be escaped, insert a common escape character \ before it to escape: \ n indicates newline. \ t indicates a tab. \ indicates that the character itself is prefixed with r in front of the string, indicating that this is a raw string, the characters in it do not need to be escaped, but R '... 'notation cannot represent a multi-line string or a string containing 'and. To represent a multi-line string, you can use '''... ''' indicates that you can add r to the front of a multi-line string to convert the multi-line string into a raw string, r '''... '''unicode string is used to input Chinese characters, u'', ur '''... ''' in case of UnicodeDecodeError, add the comment #-*-coding: UTF-8-*-in the first line, and save it... and select UTF-8 format save

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.