A list of Python learning notes

Source: Internet
Author: User

1. Three ways to create a list

#数组和列表的区别, an array can hold only one data type, and the list may contain multiple

#创建一个普通列


#创建一个混合列表


#创建一个空列表

2, three ways to add elements like List append (), extend (), insert ()

#append () and extend () can only add elements after the list

#append () add only one element

#extend () to extend another list with one list

#insert () method two parameters, the first parameter represents the position in the list, and the second parameter inserts an element at the position of the first element

A list of Python learning notes

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.