From 49e5aad690feb6c5d88802680ddb425c98a64392 Mon Sep 17 00:00:00 2001 From: Rebecca Dang Date: Tue, 21 Jul 2020 16:23:43 -0700 Subject: [PATCH 1/2] Clarify Upper instructions --- 1_beginner/chapter7/practice/upper.py | 3 ++- 1_beginner/chapter7/solutions/upper.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/1_beginner/chapter7/practice/upper.py b/1_beginner/chapter7/practice/upper.py index 2894d162..18ea29b9 100644 --- a/1_beginner/chapter7/practice/upper.py +++ b/1_beginner/chapter7/practice/upper.py @@ -1,6 +1,7 @@ # Upper # Continuously ask a user to enter words. -# (Make sure that the input given is actually just 1 word.) +# You should remove leading/trailing whitespace, and then +# make sure that the word is only made up of letters. # Store the words in a list. # Stop asking the user for words if they enter an empty string # (the string has no characters or is completely whitespace). diff --git a/1_beginner/chapter7/solutions/upper.py b/1_beginner/chapter7/solutions/upper.py index 1d10b83b..6594205f 100644 --- a/1_beginner/chapter7/solutions/upper.py +++ b/1_beginner/chapter7/solutions/upper.py @@ -1,6 +1,7 @@ # Upper # Continuously ask a user to enter words. -# (Make sure that the input given is actually just 1 word.) +# You should remove leading/trailing whitespace, and then +# make sure that the word is only made up of letters. # Store the words in a list. # Stop asking the user for words if they enter an empty string # (the string has no characters or is completely whitespace). From 24839cedba99a92a3a38048ad573979a28904d43 Mon Sep 17 00:00:00 2001 From: Rebecca Dang Date: Wed, 22 Jul 2020 10:40:01 -0700 Subject: [PATCH 2/2] Clarify Replace instructions --- 1_beginner/chapter7/practice/replace.py | 12 +++++++----- 1_beginner/chapter7/solutions/replace.py | 11 ++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/1_beginner/chapter7/practice/replace.py b/1_beginner/chapter7/practice/replace.py index 9ebe2221..86338be9 100644 --- a/1_beginner/chapter7/practice/replace.py +++ b/1_beginner/chapter7/practice/replace.py @@ -1,12 +1,14 @@ """ Replace -Write a Python program to print a string -from a given string where all occurrences -of its first char have been changed to '$', +Write a Python program that asks the user for a string +and then prints a version of that string +where all occurrences of its first char +have been changed to '$', except the first char itself. -Sample String : 'restart' -Expected Result : 'resta$t' + +Sample Input: 'restart' +Expected Output: 'resta$t' Adapted from W3Resource, problem 4: https://www.w3resource.com/python-exercises/string/ diff --git a/1_beginner/chapter7/solutions/replace.py b/1_beginner/chapter7/solutions/replace.py index e2f84c14..68bf0b37 100644 --- a/1_beginner/chapter7/solutions/replace.py +++ b/1_beginner/chapter7/solutions/replace.py @@ -1,13 +1,14 @@ """ Replace -Write a Python program to print a string -from a given string where all occurrences -of its first char have been changed to '$', +Write a Python program that asks the user for a string +and then prints a version of that string +where all occurrences of its first char +have been changed to '$', except the first char itself. -Sample String: 'restart' -Expected Result: 'resta$t' +Sample Input: 'restart' +Expected Output: 'resta$t' Adapted from W3Resource, problem 4: https://www.w3resource.com/python-exercises/string/