May-05-2019, 07:26 AM
(May-05-2019, 05:49 AM)kennethdean2010 Wrote: it just keeps loopingThat's because there is no break. You need to break it eventually. Here's an example of how it is uses -
import random loopTimes = random.randint(1, 10) while True: for x in range(1, loopTimes + 1): if x == loopTimes + 1: break #Breaks out of the while loopCould implement break after something reaches a specific value