Def find_fib(n):
if n <= 2:
return 1
fib_x, fib_next = 1, 1
i = 3<...
![World Languages](/tpl/images/cats/mir.png)
World Languages, 16.07.2021 19:40, princessa15266
Def find_fib(n):
if n <= 2:
return 1
fib_x, fib_next = 1, 1
i = 3
while i <= n:
i += 1
fib_x, fib_next = fib_next, fib_x + fib_next
return fib_next
def list_fib(n):
fib_list = [1, 1]
if n <= 2:
return fib_list[:n]
fib_x, fib_next = 1, 1
i = 3
while i <= n:
i += 1
fib_x, fib_next = fib_next, fib_x + fib_next
fib_list. append(fib_next)
return fib_list
for x in range(1, 11):
print(find_fib(x))
print(list_fib(1))
print(list_fib(2))
print(list_fib(10))
The python file needs to be modified in such a way that when the file is imported as a module, it does not show the prints at the end of the file, but when the file is run directly, it shows the prints.
![answer](/tpl/images/cats/otvet.png)
Answers: 2
Other questions on the subject: World Languages
![image](/tpl/images/cats/mir.png)
![image](/tpl/images/cats/mir.png)
![image](/tpl/images/cats/mir.png)
World Languages, 25.06.2019 17:30, nickonicyetlan
Itβs ok to use materials without referencing them as long as theyβre paraphrased in your own words. a. false b. true c. sometimes d. depends
Answers: 1
Do you know the correct answer?
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/himiya.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 10.11.2019 05:31
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/mat.png)