Skoči na vsebino

P1 - Dolgocasna vaja

from random import *
seed(8)


countThrow = 0
countFive = 0
pos = 0

while (countFive < 100):
    throwVal = randint(1, 6)
    
    if ((pos + throwVal) > 5):
        pos = pos + throwVal - 6
    else:
        pos = pos + throwVal
    
    if (pos == 5):
        countFive = countFive + 1
    
    countThrow = countThrow + 1

print(countThrow)

Zadnja posodobitev: February 27, 2022