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
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 number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Perhaps you remember the children's song "Apples and Bananas"?
11
11
I like to eat, eat, eat ee-ples and bee-nee-nees
12
12
I like to eat, eat, eat ee-ples and bee-nee-nees
13
13
14
+

15
+
14
16
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.
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 number
Diff line number
Diff line change
@@ -655,6 +655,8 @@ Perhaps you remember the children's song "Apples and Bananas"?
655
655
I like to eat, eat, eat ee-ples and bee-nee-nees
656
656
I like to eat, eat, eat ee-ples and bee-nee-nees
657
657
658
+

659
+
658
660
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.
659
661
660
662
````
@@ -1271,6 +1273,8 @@ TypeError: 'str' object does not support item assignment
1271
1273
1272
1274
## Discussion
1273
1275
1276
+

1277
+
1274
1278
The number of mutations will be proportional to the length of the text
1275
1279
1276
1280
````
@@ -3278,6 +3282,8 @@ Guess a number between 1 and 50 (q to quit): 9
3278
3282
"9"is correct. You win!
3279
3283
````
3280
3284
3285
+

3286
+
3281
3287
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:
3282
3288
3283
3289
````
@@ -3674,6 +3680,8 @@ All that is left is to check if any words matched. If so, we print them out, num
3674
3680
3675
3681
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'".
3676
3682
3683
+

3684
+
3677
3685
````
3678
3686
$ ./friar.py
3679
3687
usage: friar.py [-h] str
@@ -3769,6 +3777,8 @@ to go for a swing and maybe do some swimmin', too.
3769
3777
3770
3778
# Chapter 24: Mad Libs
3771
3779
3780
+

3781
+
3772
3782
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.
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 number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ Guess a number between 1 and 50 (q to quit): 9
18
18
"9" is correct. You win!
19
19
````
20
20
21
+

22
+
21
23
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:
0 commit comments