Skip to content

Commit e38a6f9

Browse files
author
krsm
committed
cleaning file
1 parent 89e5f1f commit e38a6f9

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

Multithreading/stdy_multithreading.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,21 @@ def calculate_square(numbers):
1313
print("calculate square numbers")
1414
for n in numbers:
1515
time.sleep(0.00000000002)
16-
print ('calculated square:',n*n)
17-
16+
print('calculated square:', n*n)
17+
18+
1819
#function 2
1920
def calculate_cube(numbers):
2021
print("calculate cube numbers")
2122
for n in numbers:
2223
time.sleep(0.00000000002)
23-
print ('calculated cube:',n*n*n)
24-
25-
26-
array_numbers = [1,2,3,4,5,6,7]
27-
24+
print('calculated cube:', n*n*n)
2825

26+
array_numbers = [1, 2, 3, 4, 5, 6, 7]
2927

3028
#creatings threads
31-
thr1 = threading.Thread(target=calculate_square,args=(array_numbers,))
32-
thr2 = threading.Thread(target=calculate_cube,args=(array_numbers,))
33-
29+
thr1 = threading.Thread(target=calculate_square, args=(array_numbers,))
30+
thr2 = threading.Thread(target=calculate_cube, args=(array_numbers,))
3431

3532
if __name__ == "__main__":
3633

@@ -45,4 +42,3 @@ def calculate_cube(numbers):
4542
thr2.join()
4643

4744
print("Executed in", time.time()-t)
48-

0 commit comments

Comments
 (0)