Categories We Write About

Create a vocabulary flashcard generator

Here’s a simple Python vocabulary flashcard generator script. It takes a list of words with their meanings and then generates flashcards you can review interactively in the console.

python
import random class FlashcardGenerator: def __init__(self, vocab): """ vocab: list of tuples [(word, meaning), ...] """ self.vocab = vocab def run(self): print("Vocabulary Flashcard GeneratornType 'exit' to quit at any time.n") while True: word, meaning = random.choice(self.vocab) print(f"Word: {word}") input("Press Enter to see the meaning...") print(f"Meaning: {meaning}n") next_action = input("Press Enter for next word or type 'exit' to quit: ").strip().lower() if next_action == 'exit': break if __name__ == "__main__": vocab_list = [ ("Aberration", "A departure from what is normal or expected"), ("Capitulate", "Cease to resist; surrender"), ("Dichotomy", "A division or contrast between two things"), ("Ebullient", "Cheerful and full of energy"), ("Facetious", "Treating serious issues with deliberately inappropriate humor"), ] flashcards = FlashcardGenerator(vocab_list) flashcards.run()

You can expand the vocab_list with your own words and meanings. Run the script, and it will randomly show you words and their definitions one by one until you type ‘exit’.

If you want it formatted as printable flashcards or saved to a file, I can help with that too!

Share This Page:

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories We Write About