Languages,  STEM

Python projects ideas for language learners

0 Flares Twitter 0 Facebook 0 Pin It Share 0 Filament.io 0 Flares ×

As part of my month of learning Spanish, I have been wondering how I could combine my language project with other learning projects that are less in focus right now.  I have been thinking about combining language learning with coding, as I want to learn to code with Python too. I finally set up a list of easy Python projects ideas for language learners.

Python projects ideas for language learners

Python projects ideas for language learners

Project 1: create your own Spanish-English dictionary with Python

Creating a dictionary in Python is not difficult. This can just take a little time to enter all the items. You use curly brackets to create the dictionary. You can give the dictionary any name you like. For each word you want to enter in the dictionary, you have to give a key, for instance the Spanish word, and associate it to a value, for instance the English word. Key and value are separated with a colon. Pairs of words are separated with commas.

Here is an example of a small dictionary:

my_dict = {‘la mujer’:’the woman’, ‘el hombre’:’the man’, ‘la casa’:’the house’ }

As you are learning more Spanish, you might want to add new pairs of words. Each time you need to index the dictionary, you should use square brackets. Here is an example:

my_dict[‘la comida’] = ‘the food’

This is also possible to delete a value.

del my_dict[‘la casa’]

Let’s say now that you want to obtain a value for a specific key.

print(my_dict[‘la mujer’])

You can also print your all dictionary.

print(my_dict)

Project 2: create a vocabulary quiz

This small project is a sequel of the first project. Indeed, once you created your dictionary, you can use the data you entered for a small quiz. The objective is to pick randomly some words that the person doing the quiz will have to translate.

Each time you want to include random elements in a program, you should start with importing the random module.

Import random

Then you can pick a random word from the dictionary:

pick = random.choice(list(my_dict.keys()))

You will need the correct translation of the word you picked:

correct_translation = my_dict.get(pick)

Then the person has to give his or her answer:

print(‘Give the English translation of’, pick)

answer = input(‘Your answer: ‘)

You can then compare the answer given by the person with the correct translation of the word. Do not forget to make sure all letters are lowercase letters.

if answer.lower() == correct_translation.lower():                                                                                                                                                                             

    print(‘you’re right’)

else: 

    print(‘This is wrong. The correct answer is’, pick)

You can choose to let the person play until he or she makes a mistake or you can decide to ask always the same number of questions and then count the number of correct and incorrect answers.

Project 3: create a complete the sentence game

This project can help you to work on your grammar or on conjugations for instance. You have sentences with holes and you have to find the missing words. For Spanish, for instance, you can create a game to work on the difference between ser/estar.

print(‘Ella ____ una mujer simpática’)

missing_word = ‘es’

user_answer = input(‘Your answer: ‘)

if missing_word.lower() == user_answer.lower():                                                                                                                                                                             

    print(‘you’re right’)

else: 

    print(‘This is wrong. The correct answer is’, missing_word)

There too, you have to think how many sentences you want to include in the game and how you want to calculate your score.

If you have other ideas of projects or if you have some ideas to improve the three projects of the post, do not hesitate to write a comment to share your ideas.

Leave a Reply

0 Flares Twitter 0 Facebook 0 Pin It Share 0 Filament.io 0 Flares ×