Python data type

Source: Internet
Author: User
Tags null null

1. Environment building and Config 2. Variable and data type data types, floating-point numbers (1.2e3,1.3e-2), Strings ("", "'," ' ") (' i\ ' m \" ok\ "! ') \ \ r ' ASDFASFA ' \ n ' ' ADSADF '

Boolean Boolean values are exactly the same as Boolean algebra, with a Boolean value of only true, false two, or true, or false, in Python, which can be used to indicate a Boolean value directly with True, false (note case), or by Boolean operations: Boolean values can be operated with and, or, and not.

Null null value is a special value in Python, denoted by none. None cannot be understood as 0, because 0 is meaningful, and none is a special null value.

In addition, Python provides a variety of data types such as lists, dictionaries, and also allows you to create custom data types, which we'll continue to talk about later.

The concept of variable variables is basically the same as the equation variables in junior algebra, but in computer programs, variables can be not only numbers, but also arbitrary data types.

Variables are represented by a variable name in the program, and the variable name must be a combination of uppercase and lowercase English, numeric, and _, and cannot start with a number, such as:

Arbitrary data types can be assigned to variables, the same variable can be repeatedly assigned, and can be different types of variables, such as:

A = 123 # A is an integer print (a) a = ' ABC ' # A becomes a string print (a)

/division evaluates to a floating-point number, even if two integers are evenly divisible, the result is also a floating point number: >>> 9/3 3.0

There is also a division is//, called the floor except, the division of two integers is still an integer:

>>> 10//3 3

Python data type

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.