Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub-courses
python_one_week_4_biologists_solutions
Commits
97bc8a3e
Unverified
Commit
97bc8a3e
authored
Jun 09, 2021
by
Bertrand NÉRON
Browse files
fix fibonacci
parent
f7903932
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/_static/code/fibonacci_iteration.py
View file @
97bc8a3e
...
...
@@ -19,12 +19,12 @@ def fibonacci(n):
elif
i
==
1
:
fib_suite
.
append
(
1
)
else
:
res
=
fib_suite
[
i
-
1
]
+
fib_suite
[
i
-
2
]
res
=
fib_suite
[
-
1
]
+
fib_suite
[
-
2
]
fib_suite
.
append
(
res
)
i
+=
1
return
fib_suite
print
', '
.
join
([
str
(
i
)
for
i
in
fibonacci
(
10
)])
print
(
', '
.
join
([
str
(
i
)
for
i
in
fibonacci
(
10
)])
)
def
fibonacci_2
(
n
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment