What is a python number? What are the python number types?

Source: Internet
Author: User
Want to know python data type,First, we need to understand what Python Number (numeric). The content of this chapter is introduced, and MathematicsThe concept of different Python Number,python Numeric typeFor storing values, Data Typeis not allowed to change, which means that if you change the value of the Number data type, the memory space will be reassigned .

So what is Python number? The following instance is created when the variable is assigned a value:

var1 = 1VAR2 = 10

You can also use the del statement to Delete some number object references.

The syntax for the DEL statement is:

Del Var1[,var2[,var3[....,varn] []]

You can delete single or multiple objects by using the DEL statement, for example:

Del Vardel var_a, Var_b

The first line means to delete the variable system named Var with the Del statement

The second line means to delete the two small categories of A and B in the Var system.

With the introduction of python number, you can draw out what is a python numeric type:

supports four different types of Python Data type :

1. integral type (INT) -usually referred to as an integral or integer, is a positive or negative integer, with no decimal points.

2. long integers -an integer with an infinite size, and an integer that ends with an uppercase or lowercase L.

3. float type (floating point real values) -float type consists of integer and fractional parts, floating-point type can also be represented by scientific notation (2.5e2 = 2.5 x 102 = 250)

4. complex numbers (complex numbers) -complex numbers are made up of real and imaginary parts, and can be represented by a + BJ, or complex (A, a, b), and the real and imaginary parts of a complex number are floating point types.

Int Log Float
Complex
10
51924361L 0.0
3.14j
100 -0x19323l 15.20
45.j
-786
0122L -21.9 9.322e-36j
080 0xDEFABCECBDAECBFBAEl 32.3+e18 .876j
-0490 535633629843L
-90. -.6545+0j
-0x260 -052318172735l -32.54e100
3e+26j
0x69 -4721885298529l 70.2-e12 4.53e-7j

1. Long integer can also use lowercase "l", but it is recommended that you use uppercase "L" to avoid confusion with the number "1". Python uses "L" to display the long integer type.

The 2.Python also supports complex numbers, which are made up of real and imaginary parts, and can be represented by a + BJ, or complex (a, b), where the real and imaginary parts of a complex number are floating point types

For more information, please visit the PHP Chinese Web Python tutorial section.

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.