Today you explored various built-in data structures in Python β Lists, Tuples, Dictionaries, and Sets β by creating your own real-world inspired tasks and solving them with creativity. This practice is key to becoming confident in problem solving with Python.
Below are the custom-built tasks that you implemented. These reflect your independent understanding of how data structures can model real-world problems effectively.
Description:
- A list of the Top 10 most advanced programming languages was created.
- The list was updated and re-ordered manually.
Highlights:
- Used
.append()to add a new language. - Used direct indexing to modify list elements.
Languages = ["Rust", "Python", "TypeScript", ...]
Languages.append("JavaScript")
Languages[0] = "Python"
Languages[1] = "JavaScript"Description:
- Created detailed dictionaries for 4 fictional/upcoming movies.
- Each dictionary included metadata (director, lead actors, ratings, pros, cons).
- Implemented a selection system using input to fetch specific movie info.
Highlights:
- Used nested dictionaries.
- Used lists inside dictionaries for pros & cons.
- Handled dictionary traversal using loops and conditionals.
Movie_list = {
"saiyaara": saiyaara_2025,
"kingdom": kingdom_2025,
...
}
movie = input("Enter the movie name: ")
for key, value in Movie_list[movie].items():
if isinstance(value, list):
for item in value:
print(item)Description:
- Created a list of tuples where each tuple represents a car brand and its models.
- Used nested loops to print each brand with its respective models.
Highlights:
- Demonstrated how tuples can pair fixed keys (brands) with list values (models).
- Used
enumerate()andindex()effectively.
car_brands = [
("BMW", ["X5", "X3"]),
("Tesla", ["Model S", "Model X"])
]Description:
- Modeled a deck of cards using nested sets.
- Demonstrated set uniqueness with repeated number input.
Highlights:
- Created a dictionary of suits, each containing a set of values.
- Used sets to automatically remove repeated numbers.
cards = {
"Hearts": {"Ace", "2", ..., "King"},
...
}
Numbers = {1, 2, 3, ..., 50, 1, 2, 3, ..., 50}- βοΈ Data modeling with real-world context
- βοΈ Using correct methods for each data structure
- βοΈ Input/output control
- βοΈ Loops, conditionals, and formatting
You did this day completely by yourself β that's a huge milestone. Keep challenging yourself with creative tasks like these to sharpen your logic and Python fluency.
π Associated Files:
lists.pytuples.pydictionary.pysets.py