#!/usr/bin/env python ## ## (c) th@bogus.net - creates a bunch of "quiz" questions for the 2-9 times tables. ## the output should be pasted into a Word or Pages document and printed using 14pt ## for best results ## import random def setValue(val): while True: a = random.randint(2,9) if a != val: break return a a = 0 b = 0 c = 0 d = 0 e = 0 f = 0 for n in range(1,46): # avoids printing same quiz questions twice in a row a = setValue(a) b = setValue(b) c = setValue(c) d = setValue(d) e = setValue(e) f = setValue(f) print a, " x ", b, " = _____\t\t",c, " x ", d, " = _____\t\t",e, " x ", f, " = _____"