Skip to content
Snippets Groups Projects
Commit a57ca700 authored by Blaise Li's avatar Blaise Li
Browse files

Merge branch 'master' of gitlab.pasteur.fr:hub-courses/python_one_week_4_biologists_solutions

parents f9e23dc7 c6c1d48d
No related branches found
No related tags found
No related merge requests found
Pipeline #58241 passed
...@@ -121,7 +121,7 @@ Exercise ...@@ -121,7 +121,7 @@ Exercise
.. literalinclude:: _static/code/restriction.py .. literalinclude:: _static/code/restriction.py
:linenos: :linenos:
:lines: 15-31 :lines: 18-33
:language: python :language: python
**pseudocode of second algorithm** **pseudocode of second algorithm**
...@@ -138,7 +138,7 @@ Exercise ...@@ -138,7 +138,7 @@ Exercise
.. literalinclude:: _static/code/restriction.py .. literalinclude:: _static/code/restriction.py
:linenos: :linenos:
:lines: 32-53 :lines: 34-55
:language: python :language: python
...@@ -172,7 +172,7 @@ in bonus we can try to sort the list in the order of the position of the binding ...@@ -172,7 +172,7 @@ in bonus we can try to sort the list in the order of the position of the binding
.. literalinclude:: _static/code/restriction.py .. literalinclude:: _static/code/restriction.py
:linenos: :linenos:
:lines: 54- :lines: 55-
:language: python :language: python
:: ::
......
...@@ -19,12 +19,12 @@ def fibonacci(n): ...@@ -19,12 +19,12 @@ def fibonacci(n):
elif i == 1: elif i == 1:
fib_suite.append(1) fib_suite.append(1)
else: else:
res = fib_suite[i-1] + fib_suite[i-2] res = fib_suite[-1] + fib_suite[-2]
fib_suite.append(res) fib_suite.append(res)
i += 1 i += 1
return fib_suite 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): def fibonacci_2(n):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment