0
A list is just a dictionary whose keys are always integers following a fixed pattern.
Im digesting what im learning. What do you think about it?
3 Answers
+ 7
List is a Data Type in Python and Dictionary is another Data Type in Python.There are more Data Types in Python like Number,String,Tupleđđđ
A list isn't always integer,it may be consist with string,float,integer or with their combination.
+ 4
By "a list is just a dictionary whose key are always integers" didn't he meant a list is a data type containing values whose indexes are always integers?
+ 2
Actually, a list is a a variable that stores some values. Example: Fruits = ["Bananas", "Pears","Apples"] So if I do print(Fruits[0]) I will get Bananas as output. A dictionary assigns values to words. Example: Football_Players = { "Good" : "Messy", "Okay" : "Ronaldo", "Bad": "Me"} If I do print("The best football player is " + Football_Players[Good] it will print The best football player is Messi