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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub-courses
python_one_week_4_biologists_solutions
Commits
e986fb63
Commit
e986fb63
authored
Jun 8, 2021
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Typos, formatting.
parent
81af9a1f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#58084
passed
Jun 8, 2021
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Collection_Data_Types.rst
+15
-9
15 additions, 9 deletions
source/Collection_Data_Types.rst
with
15 additions
and
9 deletions
source/Collection_Data_Types.rst
+
15
−
9
View file @
e986fb63
...
...
@@ -101,7 +101,7 @@ Exercise
--------
.. note::
``sum`` is a function
which
return the sum of all the elements of a list.
``sum`` is a function
that
return
s
the sum of all the elements of a list.
Wihout using the Python shell, tell what are the effects of the following statements::
...
...
@@ -135,12 +135,12 @@ Here, we compute the mean of the values contained in the list ``x``, after havin
Exercise
--------
Draw the representation in memory of the
following expressions.
::
Draw the representation in memory of the
``x`` and ``y`` variables when the following code is executed
::
x = [1, ['a', 'b', 'c'], 3, 4]
y = x[1]
y[2] = 'z'
#
w
hat is the value of x
?
#
W
hat is the value of x?
.. figure:: _static/figs/list_2-1.png
:width: 400px
...
...
@@ -152,7 +152,7 @@ Draw the representation in memory of the following expressions. ::
.. image :: _static/figs/spacer.png
When we execute *y = x[1]*, we create ``y`` wich reference the list ``['a', 'b', 'c']``.
When we execute *y = x[1]*, we create ``y`` w
h
ich reference
s
the list ``['a', 'b', 'c']``.
This list has 2 references on it: ``y`` and ``x[1]`` .
...
...
@@ -185,16 +185,22 @@ from the list l = [1, 2, 3, 4, 5, 6, 7, 8, 9] generate 2 lists l1 containing all
Exercise
--------
generate a list containing all codons.
.. note::
A codon is a triplet of nucleotides.
A nucleotide can be one of the four letters A, C, G, T
Write a function that returns a list containing strings representing all possible codons.
Write the pseudocode before proposing an implementation.
pseudocode:
"""""""""""
| *function all_codons()*
| *all_codons <- empty list*
| *let vary
ing
the first base*
| *for each first base let vary
ing
the second base*
| *for each combination first base, second base let vary
ing
the third base*
| *let vary the first base*
| *for each first base let vary the second base*
| *for each combination first base, second base let vary the third base*
| *add the concatenation base 1 base 2 base 3 to all_codons*
| *return all_codons*
...
...
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