Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python_one_week_4_biologists_solutions
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub-courses
python_one_week_4_biologists_solutions
Commits
5d43aa3e
Commit
5d43aa3e
authored
9 years ago
by
Bertrand Néron
Browse files
Options
Downloads
Patches
Plain Diff
fix typos
parent
b25bd6d9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Dive_into_Functions.rst
+12
-12
12 additions, 12 deletions
source/Dive_into_Functions.rst
with
12 additions
and
12 deletions
source/Dive_into_Functions.rst
+
12
−
12
View file @
5d43aa3e
...
...
@@ -16,7 +16,7 @@ Exercise
Without executing the code in Python interpreter, can you determine what the code below print out.
help you by drawing diagram.
**Hint** locals print a diction
n
ary with local variable as keys and their
e
respective
s
values.
**Hint** locals print a dictionary with local variable as keys and their respective values.
.. figure:: _static/figs/cf_exo_1.png
:width: 400px
...
...
@@ -46,7 +46,7 @@ Exercise
Without executing the code in Python interpreter, can you determine what the code below print out.
help you by drawing diagram.
**Hint** locals print a diction
n
ary with local variable as keys and their
e
respective
s
values.
**Hint** locals print a dictionary with local variable as keys and their respective values.
.. figure:: _static/figs/cf_exo_2.png
:width: 400px
...
...
@@ -81,7 +81,7 @@ Exercise
Without executing the code in Python interpreter, can you determine what the code below print out.
help you by drawing diagram.
**Hint** locals print a diction
n
ary with local variable as keys and their
e
respective
s
values.
**Hint** locals print a dictionary with local variable as keys and their respective values.
.. figure:: _static/figs/cf_exo_3.png
:width: 400px
...
...
@@ -122,7 +122,7 @@ Exercise
Without executing the code in Python interpreter, can you determine what the code below print out.
help you by drawing diagram.
**Hint** locals print a diction
n
ary with local variable as keys and their
e
respective
s
values.
**Hint** locals print a dictionary with local variable as keys and their respective values.
.. figure:: _static/figs/cf_exo_4.png
:width: 400px
...
...
@@ -246,7 +246,7 @@ Exercice
Without executing the code in Python interpreter, can you determine what the code below print out.
help you by drawing diagram.
**Hint** locals print a diction
n
ary with local variable as keys and their
e
respective
s
values.
**Hint** locals print a dictionary with local variable as keys and their respective values.
.. figure:: _static/figs/cf_exo_8.png
:width: 400px
...
...
@@ -367,7 +367,7 @@ help you by drawing diagram.
| in func *x* does not exist, so *x* refer to global variable *x*
| we mutate *x*
| *func2* is never executed
| we return *a* so the same object refered by *x*
| we return *a* so the same object refer
r
ed by *x*
| so *y* refer also the same object as *x*
.. container:: clearer
...
...
@@ -402,7 +402,7 @@ help you by drawing diagram.
{'a': 4, 'b': 6}
| in this code *func2* is executed
| *a* is not in *func2* names
a
pce so python find it in enclosing namespace *func*
| *a* is not in *func2* namesp
a
ce so python find it in enclosing namespace *func*
| *a* refer the same object as *x*
.. container:: clearer
...
...
@@ -436,9 +436,9 @@ help you by drawing diagram.
print x
{'a': 4, 'b': 5}
| in this code *x* a variable x is defined localy in *func2* and hide the global variable x
| this local *x* refer to a shalow copy of the *func* local variable *a* which refer to the same object as global variable *x*
| so func2 does not do a side effect on diction
n
ary referd by *x* as in previous example.
| in this code *x* a variable x is defined local
l
y in *func2* and hide the global variable x
| this local *x* refer to a shal
l
ow copy of the *func* local variable *a* which refer to the same object as global variable *x*
| so func2 does not do a side effect on dictionary refer
re
d by *x* as in previous example.
.. container:: clearer
...
...
@@ -448,8 +448,8 @@ help you by drawing diagram.
Exercice
--------
Use the code of the exe
t
rcise 4.5.7 on the kmer.
Make a function which compute all kmer of a given leng
h
t in a sequence.
Use the code of the exercise 4.5.7 on the kmer.
Make a function which compute all kmer of a given lengt
h
in a sequence.
.. literalinclude:: _static/code/kmer.py
:linenos:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment