python: python basic grammar three, list, tuple, dictionary, set_once_again_Morn’s Blog

class=”markdown_views prism-atom-one-dark”> Python Basic Grammar Article directory Python Basic Grammar List Introduction to List Slicing List modification elements List method Loop through the list sequence Basic operation of sequence range() function EMS (Employee Manager System) Exercise tuple Variable objects Dictionary (dict) Loop through dictionary Set Creation of collections Operation of sets List – A list is an object in Python – An object is an area in memory dedicated to storing data – The object we learned before, like a value, it can only hold a single data – Multiple ordered data can be saved in the list – A list is an object used to store objects – Use of lists: 1. List creation 2. Manipulate the data in the list Introduction to lists # Create a list, use [] to create a list my_list = [] # creates an empty list # print(my_list, type(my_list)) # The data stored in the list, we call it an element # Multiple elements can be stored in a list, or you can specify the elements in the list when creating the list my_list = [10] # create a list with only one element # When adding multiple elements to the list, use…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索