From 5265e795a77ebde40917c77532c324ffc3436d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bertrand=20N=C3=A9ron?= <bneron@pasteur.fr> Date: Sun, 6 Jun 2021 22:35:17 +0200 Subject: [PATCH] :allow to donload enzyme*_namedtuple.py scripts --- source/Collection_Data_Types.rst | 3 ++- source/Control_Flow_Statements.rst | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Collection_Data_Types.rst b/source/Collection_Data_Types.rst index 68058d2..511dfdc 100644 --- a/source/Collection_Data_Types.rst +++ b/source/Collection_Data_Types.rst @@ -537,7 +537,7 @@ the latter algorithm display the number of occurrence of each enzyme, But we can We will see how to do this later. Bonus -""""" +^^^^^ There is another kind of tuple which allow to access to itmes by index or name. This data collection is called NamedTuple. The NamedTuple are not accessible directly they are in `collections` package, @@ -565,6 +565,7 @@ The code must be adapted as below :linenos: :language: python +:download:`enzymes_1_namedtuple.py <_static/code/enzyme_1_namedtuple.py>` . Exercise -------- diff --git a/source/Control_Flow_Statements.rst b/source/Control_Flow_Statements.rst index a2386f2..d947efc 100644 --- a/source/Control_Flow_Statements.rst +++ b/source/Control_Flow_Statements.rst @@ -212,11 +212,11 @@ and the 2 dna fragments: :: :download:`restriction.py <_static/code/restriction.py>` . Bonus -""""" +^^^^^ If you prefer the enzyme implemeted as namedtuple -:download:`restriction.py <_static/code/restriction_namedtuple.py>` . +:download:`restriction_namedtuple.py <_static/code/restriction_namedtuple.py>` . Exercise -- GitLab