Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4bad4c8

Browse filesBrowse files
committed
images
1 parent 454cf86 commit 4bad4c8
Copy full SHA for 4bad4c8

File tree

Expand file treeCollapse file tree

14 files changed

+21
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

14 files changed

+21
-2
lines changed
Open diff view settings
Collapse file

‎apples_and_bananas/README.md‎

Copy file name to clipboardExpand all lines: apples_and_bananas/README.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Perhaps you remember the children's song "Apples and Bananas"?
1111
I like to eat, eat, eat ee-ples and bee-nee-nees
1212
I like to eat, eat, eat ee-ples and bee-nee-nees
1313

14+
![Apple and bananas go together like peas and carrots.](images/apples-and-bananas.png)
15+
1416
Write a Python program called `apples.py` that will turn all the vowels in some given text in a single positional argument into just one `-v|--vowel` (default `a`) like this song. It should complain if the `--vowel` argument isn't a single, lowercase vowel (hint, see `choices` in the `argparse` documentation). If the given text argument is a file, read the text from the file. Replace all vowels with the given vowel, both lower- and uppercase.
1517

1618
````
Collapse file

‎bin/compile.py‎

Copy file name to clipboardExpand all lines: bin/compile.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import re
1111
import sys
12-
from subprocess import getstatusoutput, getoutput
12+
from subprocess import getstatusoutput, getoutput, run
1313
from dire import die
1414

1515

@@ -148,7 +148,6 @@ def main():
148148
if rv != 0:
149149
die('Error: {}'.format(out))
150150

151-
152151
# --------------------------------------------------
153152
if __name__ == '__main__':
154153
main()
Collapse file

‎book.md‎

Copy file name to clipboardExpand all lines: book.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ Perhaps you remember the children's song "Apples and Bananas"?
655655
I like to eat, eat, eat ee-ples and bee-nee-nees
656656
I like to eat, eat, eat ee-ples and bee-nee-nees
657657

658+
![Apple and bananas go together like peas and carrots.](images/apples-and-bananas.png)
659+
658660
Write a Python program called `apples.py` that will turn all the vowels in some given text in a single positional argument into just one `-v|--vowel` (default `a`) like this song. It should complain if the `--vowel` argument isn't a single, lowercase vowel (hint, see `choices` in the `argparse` documentation). If the given text argument is a file, read the text from the file. Replace all vowels with the given vowel, both lower- and uppercase.
659661

660662
````
@@ -1271,6 +1273,8 @@ TypeError: 'str' object does not support item assignment
12711273

12721274
## Discussion
12731275

1276+
![Telephones are for communication.](images/telephone.png)
1277+
12741278
The number of mutations will be proportional to the length of the text
12751279

12761280
````
@@ -3278,6 +3282,8 @@ Guess a number between 1 and 50 (q to quit): 9
32783282
"9" is correct. You win!
32793283
````
32803284

3285+
![What does the future hold?](images/crystal_ball.png)
3286+
32813287
Because I want to be able to write a test for this, I also want the program to accept an `-i|--inputs` option so that the game can also be played exactly the same but without the prompts for input:
32823288

32833289
````
@@ -3674,6 +3680,8 @@ All that is left is to check if any words matched. If so, we print them out, num
36743680

36753681
Write a Python program called `friar.py` that reads some input text from a single positional argument on the command line (which could be a file to read) and transforms the text by dropping the "g" from words two-syllable words ending in "-ing" and also changes "you" to "y'all". Be mindful to keep the case the same on the first letter, e.g, "You" should become "Y'all," "Hunting" should become "Huntin'".
36763682

3683+
![The friar is fixin' ta do some cookin'!](images/friar.png)
3684+
36773685
````
36783686
$ ./friar.py
36793687
usage: friar.py [-h] str
@@ -3769,6 +3777,8 @@ to go for a swing and maybe do some swimmin', too.
37693777

37703778
# Chapter 24: Mad Libs
37713779

3780+
![This definitely not a copyright infringment.](images/mad_libs.png)
3781+
37723782
Write a Python program called `mad_lib.py` that will read a file given as a positional argument and find all the placeholders noted in `<>`, e.g., `<verb>`, prompt the user for the part of speech being reuqested, e.g., a "verb", and then substitute that into the text of the file, finally printing out all the placeholders replaced by the user's inputs. By default, this is an interactive program that will use the `input` prompt to ask the user for their answers, but, for testing purposes, please add a `-i|--inputs` option so the test suite can pass in all the answers and bypass the `input` calls.
37733783

37743784
````
Collapse file

‎guess/README.md‎

Copy file name to clipboardExpand all lines: guess/README.md
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Guess a number between 1 and 50 (q to quit): 9
1818
"9" is correct. You win!
1919
````
2020

21+
![What does the future hold?](images/crystal_ball.png)
22+
2123
Because I want to be able to write a test for this, I also want the program to accept an `-i|--inputs` option so that the game can also be played exactly the same but without the prompts for input:
2224

2325
````
Collapse file

‎images/apples-and-bananas.png‎

Copy file name to clipboard
20 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎images/crystal_ball.png‎

Copy file name to clipboard
15.1 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎images/friar.png‎

Copy file name to clipboard
20.5 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎images/mad_libs.png‎

Copy file name to clipboard
11.2 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎images/playful.png‎

Copy file name to clipboard
238 KB
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎images/telephone.png‎

Copy file name to clipboard
31.2 KB
  • Display the source diff
  • Display the rich diff
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.