Do you want to learn long list of names having fun? I got the program for you. You can build your own when you want changing the list of names you want to learn. In the following example, explained in the video, I will show you how to create the program to help people to memorize list of names having fun. The example, in particular, will test your memory about the countries that uses the euro as their country money. As you know there are several countries that uses euro, but not all the european countries uses them. So, which is the best way than a test to ensure that you remember them all? But you can substitute the list whith anything else you want and also compare it with your friends result as a game.
How to memorize lists of names in the most effective and fun way with a couple of lines of code in Python. In 3 minutes (even less) you will be able to create this program, understanding lists, list comprehension, for loops, the use of print and input. With a very basic knowledge of Python you can get a lot of fun (and learning). You will be able to create a lot of memory games to test yourself and your friends ability in memorizing stuffs.
The code of the memory game
Here is the code that you have seen in the video about making a game to test your memory about list of names. In this example you have to mermorize the countries that uses the euro currency.
The program uses the SAPI.SpVoice of Windows 10 to make the computer speak during the game.
from win32com.client import Dispatch
speak = Dispatch("SAPI.SpVoice")
ls = sorted("""
print("I paesi dell'Euro sono:\n")
for paese in ls:
print(paese + "."*(len(paese)-2) + paese[-1])
x = input(paese)
if paese + x == paese:
#print(ls.index(paese) + 1)
print("Mi spiace, hai sbagliato")
print("Dovevi scrivere:" + paese)
print("Punti: " + str(paese.index(paese)))
y = input("Vuoi riprovare?")
if y in "Si SI si sì Sì".split():
print("Riprova... il tuo punteggio è " + str(ls.index(paese)))
print("Bravo... il tuo punteggio è " + str(ls.index(paese)))