Three. Python data type (a) number and string __python

Source: Internet
Author: User

data type of Python

Introduction: The computer is used to assist people, in the program design also mapped the real world classification, so as to facilitate the abstract analysis

Category: 1. Digital

2. String

3. List

4. META Group

5. Dictionary


1. Number Type

Type Name Range
Integral type

Int

-2,147,483,647 to 2,147,483,647
Long Integral type Long Infinite. Mandatory type mode: 123L
Floating-point type Float
Plural type Complex

2. Strings String

Defined by: Quotation mark double quotation mark same effect

Elements: Alphanumeric symbols (non-special system symbol Collection)

note ; "" "" is a joke "" "" triple quote docstring is usually used to make a string, "" "" "

When quotation marks conflict, the pure symbol uses: \ "

value a[] such as a= "ABCD" takes the value of the first a:a[1]=a # #第一位为0 "

sliced a[:]① complete cut a=[0:4] ABCD

② Single cut A=[2:] CD

③ Solid-length value a=[::2] AC

④ negative take a=[-1] D


     

vice;

Type () function data type query function

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.