Files
labs/labPython/lab3/textfile4.py
2026-04-18 14:42:00 +05:00

19 lines
445 B
Python
Executable File

def fibonachi(num_for_stop:int) -> int:
if num_for_stop <= 0:
return 0
elif num_for_stop == 1:
return 1
else:
return fibonachi(num_for_stop-2) + fibonachi(num_for_stop-1)
num_end = int(input())
with open("d.txt", "w") as file:
count = 0
i=0
while count < num_end:
num_fib = fibonachi(i)
if num_fib%2 == 1:
file.write(f"{num_fib}\n")
count+=1
i +=1