Some knowledge of Python's data types

Source: Internet
Author: User

The int type represents a (plus or minus) integer, and the str type represents a string (a sequence of Unicode characters);

The integer size represented is limited only by machine memory, not by the number of fixed bytes.

Strings can be enclosed in double or single quotation marks and need to appear in pairs.

Traditionally, the Python shell uses >>> as its prompt, and of course it is not immutable.

Square brackets (lists) apply to arbitrary data types, tuples, and values in the dictionary are similar.

The index counts from 0 and is the same as most similar languages.

The str type and the basic numeric type int are fixed, and once set, the value cannot be changed. This will be specifically explained later. Knowledge of PVM

Int ("45") converts the string to Integer, and int ("45.6") will error. Float ("45.6") is OK

STR (56) can convert a parameter to a string

The name of a variable is consistent with the majority of the Class C language, starting with a letter or underscore, which can contain numbers, but cannot start with a number

You can use Chinese characters to make variable names, which cannot be blank in variable names.

Variable name case sensitive

Some knowledge of Python's data types

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.