from random import randint
def jeu():
    lancer1 = randint(1,9)
    if lancer1 == 1:
        gain = 6
    else:
        lancer2 = randint(1,9)
        if lancer2 <= 4:
            gain = 4
        else:
            gain = 0
    return(gain)

def gain_moyen(n):
    gain_total = 0
    for i in range(n):
        gain_total = gain_total + jeu()
    return(gain_total/n)

print(gain_moyen(100000))