--Originally published at Coding with jared
What are lists, tuples and dictionaries in Python 3?
Lists:
Like we already know a list in python is a list of values, each value is numbered starting from 0, it is possible to modify these lists by adding or removing informaiton.
You use this []
Students = [“juan”,”pedro”,michael”,”jackson”]
Tuples:
Pretty similar to lists, the only difference is that you can’t add or remove values form it.
You use this ()
meses = (‘Enero’,’Febrero’,’Marzo’,’Abril’,’Mayo’,’Junio’,’Julio’,’Agosto’,’Septiembre’,’Octubre’,’Noviembre’,’Diciembre’)
Dictionaries:
A dictionary is also like a list but the difference is that you make variables and you give them a value or a definition.
Name = key
definition = value
The keys and values that are put respectively aren’t numbered, you also can add, remove and even modify the values and keys from it.
You use this {}
oxxo = {‘gansito’:8,’sabritas’:10,’agua’:9}
I learned all this on this page, check it out: http://sthurlow.com/python/lesson06/