
This community-built FAQ covers the “Get an Invalid Key” 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 Get an Invalid Key
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply (
) below!
Agree with a comment or answer? 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!
mtf
Split this topic
2
A post was split to a new topic: Misleading again
Why am I getting an error with this, please ? 
mtf
5
Please post a link to the lesson page.
From the message given at the bottom, I assume it wants:
if "energy" in zodiac_elements:
print(zodiac_elements["energy"])
In a more general case, you’d do:
if key_to_check in zodiac_elements:
print(zodiac_elements[key_to_check])
1 Like
mtf
8
I’ve reset the lesson and done as Jan above has suggested… Follow the instructions literally and don’t create any new variables.
I appreciate it very much 
1 Like
I was stuck on the Not a Zodiac element part, and it wouldn’t let me progress because I capitalised Element. That took me a while to notice 