File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 11"""
22Replace
33
4- Write a Python program to print a string
5- from a given string where all occurrences
6- of its first char have been changed to '$',
4+ Write a Python program that asks the user for a string
5+ and then prints a version of that string
6+ where all occurrences of its first char
7+ have been changed to '$',
78except the first char itself.
8- Sample String : 'restart'
9- Expected Result : 'resta$t'
9+
10+ Sample Input: 'restart'
11+ Expected Output: 'resta$t'
1012
1113Adapted from W3Resource, problem 4:
1214https://www.w3resource.com/python-exercises/string/
Original file line number Diff line number Diff line change 11# Upper
22# Continuously ask a user to enter words.
3- # (Make sure that the input given is actually just 1 word.)
3+ # You should remove leading/trailing whitespace, and then
4+ # make sure that the word is only made up of letters.
45# Store the words in a list.
56# Stop asking the user for words if they enter an empty string
67# (the string has no characters or is completely whitespace).
Original file line number Diff line number Diff line change 11"""
22Replace
33
4- Write a Python program to print a string
5- from a given string where all occurrences
6- of its first char have been changed to '$',
4+ Write a Python program that asks the user for a string
5+ and then prints a version of that string
6+ where all occurrences of its first char
7+ have been changed to '$',
78except the first char itself.
89
9- Sample String : 'restart'
10- Expected Result : 'resta$t'
10+ Sample Input : 'restart'
11+ Expected Output : 'resta$t'
1112
1213Adapted from W3Resource, problem 4:
1314https://www.w3resource.com/python-exercises/string/
Original file line number Diff line number Diff line change 11# Upper
22# Continuously ask a user to enter words.
3- # (Make sure that the input given is actually just 1 word.)
3+ # You should remove leading/trailing whitespace, and then
4+ # make sure that the word is only made up of letters.
45# Store the words in a list.
56# Stop asking the user for words if they enter an empty string
67# (the string has no characters or is completely whitespace).
You can’t perform that action at this time.
0 commit comments