from random import randrange while True: a = randrange(20) print(a) if a == 10: break b = randrange(20) print(b)