Python Beginners Tutorial | Collections LIST | Basic Programming 5
ฝัง
- เผยแพร่เมื่อ 11 ก.ย. 2024
- There are 4 Collection data types in Python
List | Tuple | Set | Dictionary
List [] ordered | indexed | changeable | duplicates
Tuple () ordered | indexed | unchangeable | duplicates
Set {} unordered | unindexed | no duplicates
Dictionary {K:V} unordered | changeable | indexed | no duplicates
CODE - List
my_list = ["Tokyo", "London", "New York"]
print(my_list)
print(my_list[2])
my_list[2] = "New Delhi"
print(my_list)
for val in my_list:
print(val)
print(len(my_list))
my_list.append("Boston")
print(my_list)
my_list.insert(4,"Durham")
print(my_list)
my_list.remove("Tokyo")
print(my_list)
my_list.pop(1)
print(my_list)
del my_list[1]
print(my_list)
my_list.clear()
print(my_list)
fruits = ["apples", "oranges", "cherry"]
print(fruits)
fruits.reverse()
print(fruits)
my_list_2 = ["apples", 1,2,3.0]
my_list_3 = ["apples", [1,2,3], ['a','b','c']]
print(my_list_3[1][1])
#PythonBasics #Collection #List
ONLINE COURSES TO LEARN
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework - bit.ly/2Px6Ue9
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
----------- MOBILE TESTING -----------
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- JAVA -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
----------- MAVEN -----------
Maven - bit.ly/2NJdDRS
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav- bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
----------- Follow -----------
Facebook - / automationstepbystep
Twitter - / automationsbs
TH-cam - / automationstepbystep
_______ ONLINE COURSES TO LEARN _______
automationstep...