Skip to content
Sign UpLog In
Profile icon

PlatinumBirb

@lazybluebird
Repls
Community
lazybluebird
lazybluebird
shared a Post
2 years ago
How do you get a repl to stop after a certain number of times?
I’m making a generator and I want it to stop after it’s generated a certain number of things. Is that possible?
RYANTADIPARTHI
RYANTADIPARTHI
For loop You might want to make a for loop, to see how many time after you want it to stop: for i in range(5): if i == 3: break That should work2 years ago
Coder100
Coder100
What language? Just make it exit import sys while True: if input("enter done to exit") == 'done': sys.exit(0) not the best way, but it is the most versatile.2 years ago