[Python] Can I come back to the top of a 'while True' loop in python after breaking in it- or...

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to make a balance constantly go up for a game using python, but it just won't do. I make the balance go up every time the loop is repeated, but it will display the same number. As a result, I try to make python ignore that it is in a loop by breaking it, which clearly doesn't work-so I will also need an alternative to that. I am new to programming as well.

    import turtle
    q = turtle.Turtle()
    q.penup()
    q.hideturtle()
    q.goto(-190,190)
    q.write(balance)
    q.showturtle()

    def blnc():
    print(a)
    q.onclick(blnc)

    screen.listen()


    def autoclicker():
    while True:
    b.left(360)
    b.left(360)
    b.left(360)
    b.left(360)
    q.color('white')
    q.write(balance)
    q.write('000')
    q.write('888')
    q.write(101)
    q.color('black')
    b.left(360)
    q.write(balance + 1)
    break
    balance + 1
    return

    q1 = input(str("Purchase Autoclicker [100 tokens] ? Yes or No"))
    if q1== str("Yes" or "yes"):
    print "Purchased!"
    q.color('white')
    q.write('1')
    q.color('black')
    q.write(balance - 100)
    autoclicker()
    if q1==str("No" or "no" or "NO"):
    print("Ok.")

    Continue reading...

Compartilhe esta Página