FAQ: Using Dictionaries - Review

This community-built FAQ covers the “Review” exercise from the lesson “Using Dictionaries”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science

FAQs on the exercise Review

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

1 Like

2 posts were split to a new topic: Why do I get a KeyError when creating my spread?

A post was split to a new topic: How to randomize the card selection

I found an additional challenge for page 10/10 in Using Dictionaries (the Review page):
When all 6 instructions are met, it is possible for the program to generate an additional, redundant “the” before any tarot card that begins with “The”.
For example, the final output of the program will print:
Your past is the Death card.
Your present is the The Fool card.
Your future is the Wheel of Fortune card.

Challenge: what additional line(s) of code can you enter to ensure no tarot card will repeat the word “the”?

Answer:

For key, value in spread.items():

if value.count(“The”) >= 1:

print("Your " + key + " is " + value + " card.")

else:

print("Your " + key + " is the " + value + " card.")
  print("Your " + i + " is the " + j + " card")

prints:
Your past is the Death card
codecademy says:
Expected to see Your past is the Death card. printed.
how is the output not the same as ‘expected’?
wait, is it the period?, ■■■■, they’re so tiny it makes me angry at the fact it wants me to do exactly what it says