# File: ChapterControlFunc/gameDice1.py """ Roll dies till equal 0 Roll dies: 3 - 4 1 Roll dies: 4 - 4 after 2 times we got a double win """ import random def main(): print("Roll dies till equal") d1,d2 =0,1 # inital values k = 0 # counting while (d1 != d2): # not equal logical operator d1 = random.randrange(1,7) d2 = random.randrange(1,7) print(k,"Roll dies: ",d1,'-',d2) k = k + 1 print("after ", k, " times", "we got a double") if (k < 5): # winning condition print("win") else: print("lose") main()