Skip to content

Commit

Permalink
Merge pull request #29 from ananyag309/default
Browse files Browse the repository at this point in the history
added flashcard_quiz.py
  • Loading branch information
Ayu-hack authored Oct 2, 2024
2 parents 1a2d5ee + 2d5f1d7 commit 94de5a3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Flashcard_Quiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# flashcard_quiz.py
def flashcard_quiz(flashcards):
score = 0
for question, answer in flashcards.items():
user_answer = input(f"{question}: ")
if user_answer.lower() == answer.lower():
print("Correct!")
score += 1
else:
print(f"Wrong! The correct answer is: {answer}")
print(f"Your score: {score}/{len(flashcards)}")

def main():
flashcards = {
"Python": "A programming language",
"API": "Application Programming Interface",
"HTML": "HyperText Markup Language",
"CSS": "Cascading Style Sheets"
}
flashcard_quiz(flashcards)

if __name__ == "__main__":
main()

0 comments on commit 94de5a3

Please sign in to comment.