Join the conversation

Learning
Reply

List:Mutable: Aap ismein changes kar sakte hain.Ordered: Aitebaar ke saath tarteeb di gayi.Duplicates Allowed: Doosri martaba istemal ho sakta hai.Indexed Access: Index ka istemal karke items ko access kar sakte hain.Tuple:Immutable: Ek martaba ban gayi tou tabsiraat nahi kar sakte.Ordered: Tarteeb di gayi hai.Duplicates Allowed: Doosri martaba istemal ho sakta hai.Indexed Access: Index ka istemal karke items ko access kar sakte hain.Set:Mutable: Aap ismein changes kar sakte hain.Unordered: Koi tarteeb nahi hai.No Duplicates: Sirf unique items hote hain.Unindexed Access: Index ka istemal nahi kar sakte.Dictionary:Mutable: Aap ismein tabsiraat (changes) kar sakte hain.Unordered (Python 3.6 aur pehle) / Ordered (Python 3.7+): Python 3.7 se onwards order preserve hota hai.No Duplicate Keys: Har key unique hai, magar values duplicate ho sakti hain.Key-Value Access: Keys ka istemal karke items ko access kar sakte hain.
Reply

sir very easy explain
Reply

Ur teaching method is osm sir
Reply

# Data structures# List (mutable , ordered , Accept duplicate , Access by index)list = ["orange" , "apple" , "banana" , "banana"]
print(list)
print(list[2])list[2] = "papita"
print(list)
print(list[2])# Tuples (immutable , ordered , Accept duplicate , Access by index)
tuple = (1 , 2 , 3 , 4 , 5 , 6 , 2)
print(tuple)
print(tuple[6])# Sets (Muteable , unordered , no duplicate , not access by index)set = {1 , 3 , 5 ,7}
print(set)
set.add(13)
print(set)# Dictionaries(Muteable , ordered , just allow values duplicate not key , accessed by key)dict = {"babar" : 56 ,
"Shaheen" : 10 ,
"Nawaz" : 10 ,
}dict["Nawaz"] = 68
print(dict)
Reply

list are ordered and set is unordered, list has index and set has not, set remove duplicate automatically and list accept duplicates
Reply

it is good
Reply

easy way hy sir thank you very much khosh rahain aamin
Reply

Python has three mutable data structures: lists, dictionaries, and sets. Immutable data structures, on the other hand, are those that we cannot modify after their creation. The only basic built-in immutable data structure in Python is a tuple
Reply

yes
Reply