S
Size: a a a
S
AE
АР
АР
A
L
C
A
S
АР
S
S
АР
S
F
import _thread as thread
num = int(input())
fib_list = [1, 1]
fib1 = fib2 = 1
check_stop_thread = [False] * 4
if num < 2:
print('Значение должно быть больше 2х')
def make_fib_list(num1, num2, n):
for i in range(num1, num2):
fib1, fib2 = fib2, fib1 + fib2
fib_list.append(fib2)
check_stop_thread[n] = True
thread.start_new_thread(make_fib_list, (2, num // 4, 0,))
thread.start_new_thread(make_fib_list, (num // 4, num // 4 + num // 2, 1,))
thread.start_new_thread(make_fib_list, (num // 4 + num // 2, num // 2, 2,))
thread.start_new_thread(make_fib_list, (num // 2, num, 3,))
while False in check_stop_thread:
pass
else:
print(fib_list)
F
F
Unhandled exception in thread started by <function make_fib_list at 0x7f436c9750d0>
Unhandled exception in thread started by <function make_fib_list at 0x7f436c9750d0>
F
A
A