Created
July 5, 2016 15:40
-
-
Save dela3499/eebdce98dac9c196b6f42945f1fe2a49 to your computer and use it in GitHub Desktop.
Learn 4 French sentences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import time | |
from IPython.display import clear_output | |
sentences = [ | |
("I must eat.", "Je dois manger."), | |
("I want to eat.","Je veux manger."), | |
("I'm going to eat tomorrow.","Je vais manger demain."), | |
("I can't eat.","Je ne peux pas manger.") | |
] | |
t = 5 | |
for i in np.random.randint(0,10000,size = 100): | |
j = i % len(sentences) | |
question_in_english = i % 2 == 0 | |
_q, _a = sentences[j] | |
if question_in_english: | |
q, a = _q, _a | |
else: | |
a, q = _q, _a | |
clear_output() | |
print "Question: {}".format(q) | |
time.sleep(t) | |
clear_output() | |
print "Answer: {}".format(a) | |
time.sleep(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment