OK, I'm finally getting closer.

Code bellow (looks like) works if I comment out shuffle part
But I need it to shuffle so I get random picked words.

How do I get shuffle part to work?


from random import shuffle
import csv

print('Write translation of Slovene word ')
print()

out=open('c:\\prevedi.csv', 'r', newline='', encoding='utf8')
data=csv.reader(out)

# shuffle(data)

for line in data:
    question, rightAnswer = line
    answer = input(question + ' ')
    if answer.lower() != rightAnswer:
        print('Correct is: %s.' % rightAnswer,)
        print()



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to