← Back to Dashboard

Data Structures: Easy Exercises EASY

"""
Topic 05: Data Structures - EASY Exercises (10)
"""

# Exercise 1: Create a list of 5 colors and print the third color using its index.
# Write your code below:


# Exercise 2: Change the first element of your color list to "Black".
# Write your code below:


# Exercise 3: Add "White" to the end of the color list and "Purple" at the second position.
# Write your code below:


# Exercise 4: Create a tuple named 'dimensions' with three integers. Print the tuple.
# Write your code below:


# Exercise 5: Create a set of 5 unique integers. Try adding a duplicate number and print the set.
# Write your code below:


# Exercise 6: Create a dictionary for a "car" with keys: brand, model, and year. Print the brand.
# Write your code below:


# Exercise 7: Add a new key "color" to your car dictionary and update the "year" to 2024.
# Write your code below:


# Exercise 8: Remove the last item from your color list using pop().
# Write your code below:


# Exercise 9: Use a for loop to print all keys in your car dictionary.
# Write your code below:


# Exercise 10: Create a list of numbers from 1 to 5. Use a list comprehension to create a new list containing the cubes of these numbers.
# Write your code below: