What’s the Difference between a List and a ___? | Python Programming
3 min readJul 3, 2020
Lists are the backbone of Python programming language and you should know about them.
Python Data Types
The data types common to Python are as follows:
- lists
- dictionaries
- tuples
- sets
- numbers
- strings
- booleans
- and others!
What is the difference between a List and a dictionary?
A dictionary is Python is an un-ordered collection of elements that are accessed by keys. No duplicates are allowed in dictionaries.
A dictionary is made up of key-valued pairs. To access a dictionary’s elements you do so like this:
example_dictionary = {"employee_name":"Justin","employee_id":272}example_dictionary["age"] = 25 // Assign employee's age
Accessing values in a list is different. A list is an ordered collection that is changeable. Duplicate members are allowed. An example list is show below.
example_list = ["Jake","Debbie"]
example_list.append("Ralph")
print(example_list)
print(example_list[0])…