Def find_fib(n):
if n <= 2:
return 1
fib_x, fib_next = 1, 1
i = 3<...
![subject](/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.
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on World Languages
![question](/tpl/images/cats/mir.png)
World Languages, 24.06.2019 05:30
Which factors threaten the forests of north america?
Answers: 1
![question](/tpl/images/cats/mir.png)
World Languages, 26.06.2019 04:50
Escoger select the item that does not belong. la tiza la pluma la papelera la geografía el libro la economía la materia la especialización la librería la residencia estudiantil la casa la tarea la pizarra la especialización el mapa el semestre la contabilidad el español diagnostics_number_6 en la clase fill in the blanks with the appropriate form of estar. ¿dónde (1) nosotros en la clase
Answers: 1
![question](/tpl/images/cats/mir.png)
![question](/tpl/images/cats/mir.png)
World Languages, 29.06.2019 01:00
Adjectives should always use de 的 after the word, as in shūfu de 舒服的, regardless of how it's used.true or false
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 04.11.2020 18:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.11.2020 18:20
![question](/tpl/images/cats/en.png)
English, 04.11.2020 18:20
![question](/tpl/images/cats/es.png)
Spanish, 04.11.2020 18:20
![question](/tpl/images/cats/fizika.png)
Physics, 04.11.2020 18:20
![question](/tpl/images/cats/mat.png)
Mathematics, 04.11.2020 18:20
![question](/tpl/images/cats/mat.png)
Mathematics, 04.11.2020 18:20
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 04.11.2020 18:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/User.png)