The statement for i in my_dictionary : print (i)
where my_dictionary
is a dictionary
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Answer is not availble for this assesment
Please login to comment
6 Comments
Hi - this prints the tuples in the dictionary not the keys.
Upvote ShareHi,
Could you please share a screenshot of your code and it's output?
Thanks.
Upvote ShareHi,
What you have created is a dictionary of tuples. Try this:
Thanks.
1 Upvote Sharemy apologies @Rajtilak,
I made the mistake in initializing the dictionary correctly. I should've done it as:
Hi,
We all learn from our mistakes. This was a learning point for you and for all our other learners who would read this comment.
Thanks.
Upvote Share