A list is just a dictionary whose keys are always integers following a fixed pattern. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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?

5th Oct 2017, 4:25 AM
Tinotenda Makuza
Tinotenda Makuza - avatar
3 Respuestas
+ 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.
30th Jan 2018, 10:30 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 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?
30th Jan 2018, 11:01 AM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 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
31st Dec 2017, 6:30 PM
NoCUBes