[Python] Why doesn't my variable value get updated?

Discussão em 'Python' iniciado por Stack, Janeiro 21, 2025.

  1. Stack

    Stack Membro Participativo

    This is my code:

    import random

    bank = 0

    for i in range(100000):
    gamble = int(input())
    win = random.randint(1, 2)
    if win == 1 :
    print("lose")
    bank - gamble
    else:
    print("win")
    bank + gamble
    print(bank)


    Can you please help me and tell me why this doesn't this work?

    Continue reading...

Compartilhe esta Página