Skip to content

Instantly share code, notes, and snippets.

@dela3499
Created July 5, 2016 15:40
Show Gist options
  • Save dela3499/eebdce98dac9c196b6f42945f1fe2a49 to your computer and use it in GitHub Desktop.
Save dela3499/eebdce98dac9c196b6f42945f1fe2a49 to your computer and use it in GitHub Desktop.
Learn 4 French sentences
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