Question: Write code in phyton part4,part 5 and part 6. cs 101Activity 6: Functions a Strins 20 Replace as a function S Page 2 of 2

Write code in phyton part4,part 5 and part 6.
cs 101Activity 6: Functions a Strins 20 Replace as a function S Page 2 of 2 ctions and St Part 4: 1. Using a sin mer voas a function called functionkeplace Hint: You will use 1 implement the fu akes three (3)string par ree (3)sy of the replace You shouidini eed to use string concatenation parameters. You shoulwil s functin t use str.replace() method test "rep ese Part 5: Decoding a st ne string to a functi strine to do something with another. we r. We will pass a n called d that many times. We start with an empty string clString We assume the first character is not aeded a number is e number. When def decodeString(s1): Again, we use a loop to add the previous character that many times 2. go through the string and when we encounter a n able to Finally, we return s2. see the following in the Python Shell: >> decodeString(" s4e u?") 3. When you have completed this function, yo u should be coffee Part 6: Substring After 1. In class, we tried to use slicing to get the substring after a certain characte was found: >city- "Antalya citylcity.findC) alya 2. But the problem was when we gave a character that wasnit found, such as capital T. > city[city.find(") 3. Create a function called subStrAfter that takes two strings When the second string is found in the first, return the remaining string. If the second string is not found, return an empty string. Implement this function and show it to your lab instructor >> subStrafter(city, p subStrafter(city, alys CS 101 Fall 2018
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
