Difference Between List and Tuple in Python
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python
Program 1
import sys
mylist=[100,"Hello",True,12.44,15+5j,"Bhopal",100,500,100] # Mutable
# print(mylist)
# mylist.append("Bye Bye")
# print(mylist)
mytuple=(100,"Hello",True,12.44,15+5j,"Bhopal") # Immutable
# print("Size of List",sys.getsizeof(mylist))
# print("Size of Tuple",sys.getsizeof(mytuple))
#mytuple[1]="Indore City"
# print(mylist)
# mylist[1]="Indore City"
# print(mylist)
#print(type(mylist))
#print(type(mytuple))
Your opinion matters
Please write your valuable feedback about DataFlair on Google

