Skip to content

Commit 4114a34

Browse files
committed
updates
1 parent ecbddb0 commit 4114a34

3 files changed

Lines changed: 28 additions & 28 deletions

File tree

_episodes/01-intro.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ o
137137
>
138138
> Count the number of Gs in the sequence above using a `for` loop. What is the difference between Python (see above) and R (in solution below) implementations?
139139
>
140-
> > ## Solution
140+
<!-- > > ## Solution
141141
> > ~~~
142142
> > seq <- 'GACTTAATGGGCAATAGGCAAGCACTTGAAAAAGATGCCAACGACATGAAAACACAAGACAA'
143143
> > seq_split <- strsplit(seq, "")[[1]]
@@ -149,21 +149,21 @@ o
149149
> > }
150150
> > print(count)
151151
> > ~~~
152-
> {: .solution}
152+
> {: .solution} -->
153153
{: .challenge}
154154
155155
> ## What is the simplest way to count the Gs?
156156
>
157157
> Count the number of Gs in the sequence above using either R or Python in a simpler way.
158158
>
159-
> > ## Python Solution
159+
<!-- > > ## Python Solution
160160
> > ~~~
161161
> > seq <- 'GACTTAATGGGCAATAGGCAAGCACTTGAAAAAGATGCCAACGACATGAAAACACAAGA'
162162
> > print(seq.count('G'))
163163
> > ~~~
164164
> > {: .python}
165165
> {: .solution}
166-
>
166+
> -->
167167
<!-- > > ## R Solution
168168
> > ~~~
169169
> > seq <- 'GACTTAATGGGCAATAGGCAAGCACTTGAAAAAGATGCCAACGACATGAAAACACAAGA'
@@ -337,8 +337,8 @@ Each cell in a Jupyter notebook can be executed and you can choose the type of c
337337
>
338338
> Replicate one of the solutions give above in a Jupyter notebook. Add some Markdown text to describe your program.
339339
>
340-
> > ## Solution
340+
<!-- > > ## Solution
341341
> >
342342
> > ![jupyter browser](../fig/jupyter3.png)
343-
> {: .solution}
343+
> {: .solution} -->
344344
{: .challenge}

_episodes/02-datatypes.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ my_list = [0,1,2]
179179
>
180180
> Change the value of a single element in `my_list ` and `my_tuple`.
181181
>
182-
> > ## Solution: List
182+
<!-- > > ## Solution: List
183183
> >
184184
> > ~~~
185185
> > my_list[1] = 5
@@ -206,7 +206,7 @@ my_list = [0,1,2]
206206
> >TypeError: 'tuple' object does not support item assignment
207207
> > ~~~
208208
> > {: .output}
209-
> {: .solution}
209+
> {: .solution} -->
210210
{: .challenge}
211211
212212
### Assigning Elements of a List or Tuple to New Variables
@@ -393,7 +393,7 @@ for key in numbers2:
393393
>
394394
> Try to reassign the second value of `numbers2` (in the *key value pair*) so that it no longer reads "two" but instead reads "spam and eggs". What does your dictionary look like after you make this change?
395395
>
396-
> > ## Solution
396+
<!-- > > ## Solution
397397
> >
398398
> > ~~~
399399
> > numbers2[2] = 'spam and eggs'
@@ -405,7 +405,7 @@ for key in numbers2:
405405
> >{1: 'one', 2: 'spam and eggs', 3: 'three', 4: 'four'}
406406
> > ~~~
407407
> > {: .output}
408-
> {: .solution}
408+
> {: .solution} -->
409409
{: .challenge}
410410
411411
It is important to note that dictionaries in Python 3.6 or greater are insertion _ordered_ and preserve the
@@ -520,8 +520,8 @@ This is because you want your science to be reproducible
520520
by anyone who evaluates your work or wishes to build
521521
on your findings. But, even more importantly, you
522522
need to properly document your code so that **_you_**
523-
know what your own code does when you open your
524-
code-base again after spending several months finishing
523+
know what your own programs and scripts do when you open your
524+
them again after spending several months finishing
525525
some other project.
526526
527527
Here are some basic tips for writing code
@@ -566,7 +566,7 @@ These are called *Docstrings* and are inserted right
566566
after the first line instantiating the function.
567567
568568
~~~
569-
def my_cool_function(a, b):
569+
def cat_two_strings(a, b):
570570
"""Description: Concatenates two strings
571571

572572
Parameters:
@@ -576,10 +576,10 @@ def my_cool_function(a, b):
576576
Return: a string that is a + b
577577

578578
Example of usage:
579-
>string_a = "howdy "
580-
>string_b = "world"
581-
>cool_string = my_cool_function(string_a, string_b)
582-
>print(cool_string)
579+
>> string_a = "howdy "
580+
>> string_b = "world"
581+
>> ab_string = cat_two_strings(string_a, string_b)
582+
>> print(ab_string)
583583

584584
Output:
585585
howdy world
@@ -594,14 +594,14 @@ is defined, the information from the Docstring is
594594
available using the `help()` function:
595595
596596
~~~
597-
help(my_cool_function)
597+
help(cat_two_strings)
598598
~~~
599599
{: .python}
600600
601601
~~~
602-
Help on function my_cool_function in module __main__:
602+
Help on function cat_two_strings in module __main__:
603603

604-
my_cool_function(a, b)
604+
cat_two_strings(a, b)
605605
Description: Concatenates two strings
606606

607607
Parameters:
@@ -611,10 +611,10 @@ my_cool_function(a, b)
611611
Return: a string that is a + b
612612

613613
Example of usage:
614-
>string_a = "howdy "
615-
>string_b = "world"
616-
>cool_string = my_cool_function(string_a, string_b)
617-
>print(cool_string)
614+
>> string_a = "howdy "
615+
>> string_b = "world"
616+
>> ab_string = cat_two_strings(string_a, string_b)
617+
>> print(ab_string)
618618

619619
Output:
620620
howdy world
@@ -624,20 +624,20 @@ my_cool_function(a, b)
624624
## In-line Comments
625625
You may also find it necessary to add comments
626626
within your code. In Python comments are
627-
preceded by a `#`. It really is up to you
627+
preceded by an octothorpe (i.e., `#`). It really is up to you
628628
to decide when and how to use such comments.
629629
Ultimately, this type of documentation is
630630
really for adding information or details
631631
in places where it isn't obvious from the
632632
code what is going on. Another use for
633633
in-line comments is to add flags for debugging
634-
or "to-dos" or something. In these cases,
635-
the comments should be written on the line
634+
or "to-dos" for work that is currently in progress.
635+
In these cases, the comments should be written on the line
636636
above the code it refers to or just to the
637637
right on the same line.
638638
639639
~~~
640-
def my_cool_function(a, b):
640+
def cat_two_strings(a, b):
641641
return a + b # TODO: verify that a & b are strings
642642
~~~
643643
{: .python}

fig/02-func-docs.png

19.2 KB
Loading

0 commit comments

Comments
 (0)