Python Nested Data Exercises

Let’s check out some exercises that will help understand Nested Data better.

Exercise 6-a

Print 5 by accessing the nested data.


You can chain the bracket notation: [][][] to access the element you need.

ans_1 = nested_lst[1][1]

Exercise 6-b

Print "Z" from the nested data.


You can chain the bracket notation: [][][] to access the element you need.

ans_1 = nested_lst[1][1][0]

Exercise 6-c

What color is the violet?


You can chain the bracket notation: [][][] to access the element you need.

ans_1 = nested_lst[2]["violet"]

Need More Exercises?

Check out Holy Python AI+ for amazing Python learning tools.

*Includes 14 more programming languages, inspirational tools and 1-on-1 consulting options.
Umut Sagir
Finance & Data Science Professional,
Founder of HolyPython