First page Back Continue Last page Overview Graphics

Example with class, 2

threads = []

while True:

value = int(input("number: "))

if value < 1:

break

thread = PrimeNumber(value)

threads += [thread]

thread.start()

for x in threads:

x.join()