Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
440 B
1
Indexable
Never
import threading
import math

def rrenja_katrore(numri):
    rrenja_katrore = math.sqrt(numri)
    print(f"Rrenja katrore e {numri} eshte {rrenja_katrore}")

numrat = [1, 2, 4, 9, 16, 25, 36, 49]
threads = []

for numri in numrat:
    thread = threading.Thread(target=rrenja_katrore, args=(numri,))
    threads.append(thread)
    thread.start()

for thread in threads:
    thread.join()

print("Ekzekutimi i programit perfundoi me sukses!")
Leave a Comment