Lists in Python | Python Lists | Lists Functions in Python | Implementation of Lists in Python | Use of Lists in Python | Python by Gaurav Pali
Lists in Python | Python Lists | Lists Functions in Python | Implementation of Lists in Python | Use of Lists in Python | Python by Gaurav Pali
Video Link:- https://youtu.be/4mfBYuLAlbY
Code:
##a=[10,20,30,40,50,60,70,20]
##print(a)
##for i in range(len(a)):
## print(a[i])
##print(a[-4:-2])
##b=["abc","xyz","pqr"]
##print(b[1])
##a[3]=90
##print(len(a))
##c=[True, True,False,True,False]
##print(c)
##mix=[1,5,"hello",7,"bye",False,12,True,"good",6.5,8]
##print(mix)
##li=list(("Mouse","Keyboard","Scanner","Motherboard"))
##print(li)
##
##print(type(a))
##print(type(b))
##print(type(c))
##print(type(mix))
##print(type(li))
##if "Mouse" in li:
## print("yes, Mouse is in the list")
##li[1]="Mike"
##print(li)
##li[1:3]=["CPU"]
##print(li)
##
##li.insert(2,"Monitor")
##print(li)
##li.append("CPU")
##print(li)
##
##rr=[1,2,3,4,5]
##qq=["hello","bye"]
##print(rr)
##print(qq)
##rr.extend(qq)
##print(rr)
##print(qq)
##f=("a","b","c")
##qq.extend(f)
##print(qq)
##a=[10,20,30,40,50,30,60,70,30,40,30]
##print(a)
##a.remove(40)
##print(a)
##a.sort(reverse=True)
##print(a)
ww=[1,2,3,4]
yy=["x","y","z"]
print(ww)
print(yy)
for i in yy:
ww.append(i)
print(ww)
print(yy)
##print(a.pop())
##print(a)
##a.clear()
##print(a)
##for i in a:
## print(i)
##
##i=0
##while i<len(a):
## print(a[i])
## i+=1
##b=a.copy()
##print(b)
##print(a.count(300))
You can also visit my YouTube Channel
Gaurav Pali MCA