Python data type

Source: Internet
Author: User

Intlongfloatcomplexboolean

List, tuple

Lists: list []

Change and delete

Name.append[] Append to the last one,

Name.insert (1, "xxxxx") add xxxxx to subscript 1

name.remove[' xxx '],

Del Name[1],

Name.pop (subscript) Delete the last one by default

name[3]= ' 23112 '

Name[1:3] Shows 1 and 2,

NAME[-3:0] Show Countdown third to last, slice order from left to right

name.index["21"] find the location of 21

name.count["66"] how many of the lookup lists are 66

Name.clear[] Clear List

Name.reverse () reverse list

Name.sout () sorted by first letter Ascii

Name.extend (list2), merge List2 into name

Name.copy (), copying a copy, but the list element in the table will change, if you want to copy a separate data can be used in the following ways

Import Copy

List_a = Copy.deepcpoy (list_b)

String dictionary collection file encoded transcoding built-in functions

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.