Python variable type-numeric type number (4 detailed)

Source: Internet
Author: User
In this article, I'm talking about Python. Standard Number Type, hoping to help you reach out to Python.

There are several types of data that can be stored in memory.

For example, a person's age can be stored in numbers, and his name can be stored in characters.

Python defines some standard types for storing various types of data, with five standard data types in Python:

Numbers (digital)

String (String)

List (lists)

Tuple (tuple)

Dictionary (dictionary)

Let's take a look at these five standard data types.

(1) Number(number): Numeric data type is used to store numeric values. They are immutable data types, which means that changing the numeric data type assigns a new object.

When you specify a value, the number object is created. The following example:

var1 = 1VAR2 = 10

The above example defines the var1=1,var2=10, since it is possible to define a Delete method, you can use Del to delete some object references, Del's syntax is relatively simple, for example:

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

You can also use the DEL statement to delete references to individual or multiple objects, such as:

Del Vardel var_a, Var_b

As shown, you can delete a reference to a single or multiple objects.

Python supports 4 different numeric types altogether:

int (signed integral type)

Long (longer integer [can also represent octal and hexadecimal])

Float (float type)

Complex (plural)

(Long integers 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. )

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

This is the first part of the numeric type in Python for a standard number type, which is not difficult to understand, and hopefully this article will help you in learning Python.

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.