import random
import pyprind
random.seed(1)
collection = set()
import time
n = 100
bar = pyprind.ProgBar(n, track_time=False, title='while example')
i=0
while i < n:
r = random.randint(0, 10**5)
if r % 7 and r not in collection:
collection.add(r)
bar.update()
i=i+10
time.sleep(0.04)
The code above does not work. Please give me some advice, thanks.
while example
0% [### ] 100%
import random import pyprind random.seed(1) collection = set() import time n = 100 bar = pyprind.ProgBar(n, track_time=False, title='while example') i=0 while i < n: r = random.randint(0, 10**5) if r % 7 and r not in collection: collection.add(r) bar.update() i=i+10 time.sleep(0.04) The code above does not work. Please give me some advice, thanks. while example 0% [### ] 100%