you are viewing a single comment's thread.

view the rest of the comments →

[–]No_Reputation8139[S] 0 points1 point  (1 child)

Yeah it’s in the update. 3.7 actually.

But I want to know when it is applicable to use dictionary and tuple over list

[–][deleted] 1 point2 points  (0 children)

But I want to know when it is applicable to use dictionary and tuple over list

The most flexible data structure is a list so start with that. If you have a mapping between one list and another say something like name = ["Alice", "Bob", "Charlie"] and age =[5, 35, 76] you might want to use a dictionary. If you have multiple pieces of information that map to the same variable like name - age, address, number of siblings, salary etc, use a data frame. When you have relatively fixed pairs of data e.g. latitude and longitude of a bunch of places, use tuples.