click below
click below
Normal Size Small Size show me how
Stack #4560563
4 times tables
| Question | Answer |
|---|---|
| 4 Times Table Study Stack | |
| Create the study stack as a list of flashcards | |
| study_stack = [ | |
| {"question": "4 x 1", "answer": 4}, | |
| {"question": "4 x 2", "answer": 8}, | |
| {"question": "4 x 3", "answer": 12}, | |
| {"question": "4 x 4", "answer": 16}, | |
| {"question": "4 x 5", "answer": 20}, | |
| {"question": "4 x 6", "answer": 24}, | |
| {"question": "4 x 7", "answer": 28}, | |
| {"question": "4 x 8", "answer": 32}, | |
| {"question": "4 x 9", "answer": 36}, | |
| {"question": "4 x 10", "answer": 40} | |
| ] | |
| print("🧠 Welcome to the 4 Times Table Study Stack!") | |
| print("Try to answer each question. Type 'exit' to quit.\n") | |
| score = 0 | |
| for card in study_stack: | |
| user_input = input(f"What is {card['question']}? ") | |
| if user_input.lower() == "exit": | |
| break | |
| elif user_input.isdigit() and int(user_input) == card["answer"]: | |
| print("✅ Correct!\n") | |
| score += 1 | |
| else: | |
| print(f"❌ Oops! The correct answer is {card['answer']}.\n") | |
| print(f"🎯 You got {score} out of {len(study_stack)} correct!") | |
| print("Thanks for studying the 4 times table! 💪") |