from random import randrange def duel(): sentinel = 0 arraya = [] arrayb = [] while sentinel < 1000: a = randrange(1, 3) b = randrange(1, 4) if a == 1: arraya.append(sentinel) if b == 1: arrayb.append(sentinel) sentinel += 1 percenta = str((len(arraya) / 1000.0) * 100) percentb = str((len(arrayb) / 1000.0) * 100) print "A wins the duel " + percenta + "% of the time." print "B wins the duel " + percentb + "% of the time." duel()