Main content
Course: Intro to computer science - Python > Unit 2
Lesson 3: Chained conditionalsChallenge: Flashcards
Instructions
Step 1
Print the correct answer
Erick created a flashcard program to help him review Python concepts. As he’s studying, he realizes that when he gets a question wrong, it would help if the program showed the correct answer. That way, he can learn from his mistakes!
- For each question, if the user enters an incorrect answer, print the correct answer.
For example, if the user answers 4
for the second question, the program might print: The correct answer is: 2
. Careful - if the user enters the correct answer, the program should still print: You got it!
, but it should not print: The correct answer is: 2
.