You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b3e25f7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: _sources/exercises/list_lab.rst.txt
+12-15Lines changed: 12 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,9 @@ to query the user for info at the command line, you use:
29
29
Procedure
30
30
---------
31
31
32
-
In your student dir in the class repo, create a ``lesson03`` dir and put in a new ``list_lab.py`` file.
32
+
In the github classroom repo for this exercise, you will find a``list_lab.py`` file (if it not there, you can create it and add it to git yourself).
33
33
34
-
The file should be an executable Python script. That is to say that one
34
+
The file should be made an executable Python script. That is to say that one
35
35
should be able to run the script directly like so:
36
36
37
37
.. code-block:: bash
@@ -50,11 +50,11 @@ should be able to run the script directly like so:
50
50
51
51
The file will also need this on the first line::
52
52
53
-
#!/usr/bin/env python3
53
+
#!/usr/bin/env python
54
54
55
-
This is known as the "she-bang" line -- it tells the shell how to execute that file -- in this case, with ``python3``
55
+
This is known as the "she-bang" line -- it tells the shell how to execute that file -- in this case, with ``python``
56
56
57
-
NOTE: on Windows, there is a python launcher which, if everything is configured correctly will look at that line to know you want python3 if there is more than one python on your system.
57
+
NOTE: on Windows, there is a python launcher which, if everything is configured correctly will look at that line to know you want python if there is more than one python on your system.
58
58
59
59
If this doesn't work on Windows, just run the file some other way:
60
60
@@ -63,14 +63,11 @@ If this doesn't work on Windows, just run the file some other way:
63
63
- from your IDE or editor is you are using one
64
64
65
65
66
-
Add the file to your clone of the repository and commit changes frequently
66
+
Make sure the file is added to your clone of the repository and commit changes frequently
67
67
while working on the following tasks. When you are done, push your changes to
68
-
GitHub and issue a pull request.
68
+
GitHub and issue a pull request to let the instructors know it is ready for review.
69
69
70
-
(if you are still struggling with git -- just write the code for now).
71
-
72
-
When the script is run, it should accomplish the following four series of
73
-
actions:
70
+
When the script is run, it should accomplish the following four series of actions:
74
71
75
72
Series 1
76
73
--------
@@ -79,8 +76,8 @@ Series 1
79
76
- Display the list (plain old ``print()`` is fine...).
80
77
- Ask the user for another fruit and add it to the end of the list.
81
78
- Display the list.
82
-
- Ask the user for a number and display the number back to the user and the
83
-
fruit corresponding to that number (on a 1-is-first basis). Remember that Python uses zero-based indexing, so you will need to correct.
79
+
- Ask the user for a number and display the number back to the user
80
+
and the fruit corresponding to that number (on a 1-is-first basis). Remember that Python uses zero-based indexing, so you will need to correct for that.
84
81
- Add another fruit to the beginning of the list using "+" and display the
85
82
list.
86
83
- Add another fruit to the beginning of the list using ``insert()`` and display the list.
@@ -105,8 +102,8 @@ Again, using the list from series 1:
105
102
106
103
- Ask the user for input displaying a line like "Do you like apples?" for each fruit in the list (making the fruit all lowercase).
107
104
- For each "no", delete that fruit from the list.
108
-
- For any answer that is not "yes" or "no", prompt the user to answer with one
109
-
of those two values (a while loop is good here)
105
+
- For any answer that is not "yes" or "no", prompt the user to answer
106
+
with one of those two values (a while loop is good here)
Copy file name to clipboardExpand all lines: exercises/list_lab.html
+12-14Lines changed: 12 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -205,8 +205,8 @@ <h3>Hint<a class="headerlink" href="#hint" title="Permalink to this headline">¶
205
205
</div>
206
206
<divclass="section" id="procedure">
207
207
<h3>Procedure<aclass="headerlink" href="#procedure" title="Permalink to this headline">¶</a></h3>
208
-
<p>In your student dir in the class repo, create a <codeclass="docutils literal notranslate"><spanclass="pre">lesson03</span></code> dir and put in a new <codeclass="docutils literal notranslate"><spanclass="pre">list_lab.py</span></code> file.</p>
209
-
<p>The file should be an executable Python script. That is to say that one
208
+
<p>In the github classroom repo for this exercise, you will find a``list_lab.py`` file (if it not there, you can create it and add it to git yourself).</p>
209
+
<p>The file should be made an executable Python script. That is to say that one
210
210
should be able to run the script directly like so:</p>
<p>This is known as the “she-bang” line – it tells the shell how to execute that file – in this case, with <codeclass="docutils literal notranslate"><spanclass="pre">python3</span></code></p>
225
-
<p>NOTE: on Windows, there is a python launcher which, if everything is configured correctly will look at that line to know you want python3 if there is more than one python on your system.</p>
224
+
<p>This is known as the “she-bang” line – it tells the shell how to execute that file – in this case, with <codeclass="docutils literal notranslate"><spanclass="pre">python</span></code></p>
225
+
<p>NOTE: on Windows, there is a python launcher which, if everything is configured correctly will look at that line to know you want python if there is more than one python on your system.</p>
226
226
<p>If this doesn’t work on Windows, just run the file some other way:</p>
227
227
<blockquote>
228
228
<div><ulclass="simple">
@@ -231,12 +231,10 @@ <h3>Procedure<a class="headerlink" href="#procedure" title="Permalink to this he
231
231
<li><p>from your IDE or editor is you are using one</p></li>
232
232
</ul>
233
233
</div></blockquote>
234
-
<p>Add the file to your clone of the repository and commit changes frequently
234
+
<p>Make sure the file is added to your clone of the repository and commit changes frequently
235
235
while working on the following tasks. When you are done, push your changes to
236
-
GitHub and issue a pull request.</p>
237
-
<p>(if you are still struggling with git – just write the code for now).</p>
238
-
<p>When the script is run, it should accomplish the following four series of
239
-
actions:</p>
236
+
GitHub and issue a pull request to let the instructors know it is ready for review.</p>
237
+
<p>When the script is run, it should accomplish the following four series of actions:</p>
240
238
</div>
241
239
<divclass="section" id="series-1">
242
240
<h3>Series 1<aclass="headerlink" href="#series-1" title="Permalink to this headline">¶</a></h3>
@@ -245,8 +243,8 @@ <h3>Series 1<a class="headerlink" href="#series-1" title="Permalink to this head
245
243
<li><p>Display the list (plain old <codeclass="docutils literal notranslate"><spanclass="pre">print()</span></code> is fine…).</p></li>
246
244
<li><p>Ask the user for another fruit and add it to the end of the list.</p></li>
247
245
<li><p>Display the list.</p></li>
248
-
<li><p>Ask the user for a number and display the number back to the user and the
249
-
fruit corresponding to that number (on a 1-is-first basis). Remember that Python uses zero-based indexing, so you will need to correct.</p></li>
246
+
<li><p>Ask the user for a number and display the number back to the user
247
+
and the fruit corresponding to that number (on a 1-is-first basis). Remember that Python uses zero-based indexing, so you will need to correct for that.</p></li>
250
248
<li><p>Add another fruit to the beginning of the list using “+” and display the
251
249
list.</p></li>
252
250
<li><p>Add another fruit to the beginning of the list using <codeclass="docutils literal notranslate"><spanclass="pre">insert()</span></code> and display the list.</p></li>
@@ -270,8 +268,8 @@ <h3>Series 3<a class="headerlink" href="#series-3" title="Permalink to this head
270
268
<ulclass="simple">
271
269
<li><p>Ask the user for input displaying a line like “Do you like apples?” for each fruit in the list (making the fruit all lowercase).</p></li>
272
270
<li><p>For each “no”, delete that fruit from the list.</p></li>
273
-
<li><p>For any answer that is not “yes” or “no”, prompt the user to answer with one
274
-
of those two values (a while loop is good here)</p></li>
271
+
<li><p>For any answer that is not “yes” or “no”, prompt the user to answer
272
+
with one of those two values (a while loop is good here)</p></li>
0 commit comments