Skip to content

Commit ad5f24c

Browse files
CristianRiccioCristianRiccio
authored andcommitted
Correction of typos of day 1
I have corrected the typos in the Jupyter Notebooks of Day 1. Beware! I have run the scripts in Jupyter with Python 2 and it seems that it made some changes in the code. Hopefully you can select the changes you want and the ones you don’t.
1 parent 6a2ff3e commit ad5f24c

3 files changed

Lines changed: 28 additions & 27 deletions

Introduction_to_python_day_1_session_2.ipynb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"- __Cannot__ be altered once created (they are immutable)\n",
3232
"- Items have a defined order\n",
3333
"\n",
34-
"Tuples are created by using round brackets around the items it contains, with commas seperating the individual elements."
34+
"A tuple is created by using round brackets around the items it contains, with commas seperating the individual elements."
3535
]
3636
},
3737
{
@@ -351,7 +351,7 @@
351351
"cell_type": "markdown",
352352
"metadata": {},
353353
"source": [
354-
"or insert values at a certain positions with <tt>insert()</tt>, by supplying the desired position as well as the new value"
354+
"or insert values at a certain position with <tt>insert()</tt>, by supplying the desired position as well as the new value"
355355
]
356356
},
357357
{
@@ -603,9 +603,9 @@
603603
"cell_type": "markdown",
604604
"metadata": {},
605605
"source": [
606-
"When we are reading text from files etc. (which we will see later on), often there is unwanted whitespace at the start or end of the string. We can remove leading whitespace with the <tt>.lstrip()</tt> method, trailing whitespace with <tt>.rstrip()</tt>, and whitespace from both ends with <tt>.strip()</tt>.\n",
606+
"When we are reading text from files (which we will see later on), often there is unwanted whitespace at the start or end of the string. We can remove leading whitespace with the <tt>.lstrip()</tt> method, trailing whitespace with <tt>.rstrip()</tt>, and whitespace from both ends with <tt>.strip()</tt>.\n",
607607
"\n",
608-
"All of these methods return a copy of the changes string, so if you want to replace the original you can assign the result of the method call to the original variable."
608+
"All of these methods return a copy of the changed string, so if you want to replace the original you can assign the result of the method call to the original variable."
609609
]
610610
},
611611
{
@@ -656,7 +656,7 @@
656656
"cell_type": "markdown",
657657
"metadata": {},
658658
"source": [
659-
"<tt>.split()</tt> is the counterpart to the <tt>.join()</tt> method that lets you join the elements of a list into a string only if all the elements are of String:"
659+
"<tt>.split()</tt> is the counterpart to the <tt>.join()</tt> method that lets you join the elements of a list into a string only if all the elements are of type String:"
660660
]
661661
},
662662
{
@@ -669,6 +669,7 @@
669669
"source": [
670670
"seq = \"ATG TCA CCG GGC\"\n",
671671
"codons = seq.split(\" \")\n",
672+
"print(codons)\n",
672673
"print(\"|\".join(codons))"
673674
]
674675
},
@@ -1093,21 +1094,21 @@
10931094
"metadata": {
10941095
"celltoolbar": "Slideshow",
10951096
"kernelspec": {
1096-
"display_name": "Python 3",
1097+
"display_name": "Python 2",
10971098
"language": "python",
1098-
"name": "python3"
1099+
"name": "python2"
10991100
},
11001101
"language_info": {
11011102
"codemirror_mode": {
11021103
"name": "ipython",
1103-
"version": 3
1104+
"version": 2
11041105
},
11051106
"file_extension": ".py",
11061107
"mimetype": "text/x-python",
11071108
"name": "python",
11081109
"nbconvert_exporter": "python",
1109-
"pygments_lexer": "ipython3",
1110-
"version": "3.5.2"
1110+
"pygments_lexer": "ipython2",
1111+
"version": "2.7.12"
11111112
}
11121113
},
11131114
"nbformat": 4,

Introduction_to_python_day_1_session_3.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"cell_type": "markdown",
2727
"metadata": {},
2828
"source": [
29-
"A program will normally run by executing the stated commands, one after the other in sequential order. Frequently however, you will need the program to deviate from this. There several ways of diverting from the line-by-line paradigm:\n",
29+
"A program will normally run by executing the stated commands, one after the other in sequential order. Frequently however, you will need the program to deviate from this. There are several ways of diverting from the line-by-line paradigm:\n",
3030
"\n",
3131
"- With conditional statements. Here you can check if some statement or expression is true, and if it is then you continue on with the following block of code, otherwise you might skip it or execute a different bit of code.\n",
3232
"\n",
@@ -91,7 +91,7 @@
9191
"cell_type": "markdown",
9292
"metadata": {},
9393
"source": [
94-
"A conditional <tt>if</tt> statement, is used to specify that some block of code should only be executed if some associated test is upheld; a conditional expression evaluates to <tt>True</tt>. This might also involve subsidiary checks using the <tt>elif</tt> statement to use an alternative block if the previous expression turns out to be False. There can even be a final <tt>else</tt> statement to do something if none of the checks are passed. \n",
94+
"A conditional <tt>if</tt> statement is used to specify that some block of code should only be executed if some associated test is upheld; a conditional expression evaluates to <tt>True</tt>. This might also involve subsidiary checks using the <tt>elif</tt> statement to use an alternative block if the previous expression turns out to be False. There can even be a final <tt>else</tt> statement to do something if none of the checks are passed. \n",
9595
"\n",
9696
"The following uses statements that test whether a number is less than zero, greater than zero or otherwise equal to zero and will print out a different message in each case:"
9797
]
@@ -351,21 +351,21 @@
351351
],
352352
"metadata": {
353353
"kernelspec": {
354-
"display_name": "Python 3",
354+
"display_name": "Python 2",
355355
"language": "python",
356-
"name": "python3"
356+
"name": "python2"
357357
},
358358
"language_info": {
359359
"codemirror_mode": {
360360
"name": "ipython",
361-
"version": 3
361+
"version": 2
362362
},
363363
"file_extension": ".py",
364364
"mimetype": "text/x-python",
365365
"name": "python",
366366
"nbconvert_exporter": "python",
367-
"pygments_lexer": "ipython3",
368-
"version": "3.5.2"
367+
"pygments_lexer": "ipython2",
368+
"version": "2.7.12"
369369
}
370370
},
371371
"nbformat": 4,

Introduction_to_python_day_1_session_4.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"cell_type": "markdown",
199199
"metadata": {},
200200
"source": [
201-
"Whats going on here is that the value is doubled in each loop and once it gets to 8 the while test fails (8 is not less than 8) and that last value is preserved. Note that if the test were instead value `<= 8` then we would get one more doubling and the value would reach 16."
201+
"Whats going on here is that the value is doubled in each iteration and once it gets to 8 the while test fails (8 is not less than 8) and that last value is preserved. Note that if the test were instead value `<= 8` then we would get one more doubling and the value would reach 16."
202202
]
203203
},
204204
{
@@ -228,7 +228,7 @@
228228
"total = 0\n",
229229
"for v in values:\n",
230230
" if v < 0:\n",
231-
" continue \t# Skip this loop\n",
231+
" continue \t# Skip this iteration\n",
232232
" \n",
233233
" total += v\n",
234234
"\n",
@@ -292,8 +292,8 @@
292292
"source": [
293293
"## Exercises 1.4.1\n",
294294
"\n",
295-
"1. Create a list where each element is an individual base of DNA. Make the array 15 bases long.\n",
296-
"2. Print the length of the list.\n",
295+
"1. Create a sequence where each element is an individual base of DNA. Make the sequence 15 bases long.\n",
296+
"2. Print the length of the sequence.\n",
297297
"3. Create a for loop to output every base of the sequence on a new line.\n",
298298
"4. Create a <tt>while</tt> loop similar to the one above that starts at the third base in the sequence and outputs every third base until the 12th."
299299
]
@@ -516,7 +516,7 @@
516516
"source": [
517517
"## Exercises 1.4.2\n",
518518
"\n",
519-
"1. Let's calculate GC content of a DNA sequence. Use the 15-base array you created for the exercises above. Create a variable, `gc`, which we will use to count the number of Gs or Cs in our sequence.\n",
519+
"1. Let's calculate the GC content of a DNA sequence. Use the 15-base sequence you created for the exercises above. Create a variable, `gc`, which we will use to count the number of Gs or Cs in our sequence.\n",
520520
"2. Create a loop to iterate over the bases in your sequence. If the base is a G or the base is a C, add one to your `gc` variable.\n",
521521
"3. When the loop is done, divide the number of GC bases by the length of the sequence and multiply by 100 to get the GC percentage."
522522
]
@@ -533,21 +533,21 @@
533533
],
534534
"metadata": {
535535
"kernelspec": {
536-
"display_name": "Python 3",
536+
"display_name": "Python 2",
537537
"language": "python",
538-
"name": "python3"
538+
"name": "python2"
539539
},
540540
"language_info": {
541541
"codemirror_mode": {
542542
"name": "ipython",
543-
"version": 3
543+
"version": 2
544544
},
545545
"file_extension": ".py",
546546
"mimetype": "text/x-python",
547547
"name": "python",
548548
"nbconvert_exporter": "python",
549-
"pygments_lexer": "ipython3",
550-
"version": "3.5.2"
549+
"pygments_lexer": "ipython2",
550+
"version": "2.7.12"
551551
}
552552
},
553553
"nbformat": 4,

0 commit comments

Comments
 (0)