Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17360

How to make this while loop to stop?

$
0
0

When I run the code the while loop it is supposed to stop when number = 2 but it never stops. I use github codespace to run code

import timeimport randomGet = 0Trys = 0while Get == 0:     time.sleep(0)    Trys = Trys + 1    Number = str(random.randint(1, 2))    print(Number, Trys)    if Number == 2:        breakprint("finished")```

Viewing all articles
Browse latest Browse all 17360

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>