Question: python, pls follow all requirements thank you = zyBooks & O, 8.20 Homework 6 - String This homework requires you to write three functions as

python, pls follow all requirements thank you
python, pls follow all requirements thank you = zyBooks & O, 8.20
Homework 6 - String This homework requires you to write three functions
as described below 1. Write a function called swap that takes a
string and two integers and swaps the letters found at the locations

= zyBooks & O, 8.20 Homework 6 - String This homework requires you to write three functions as described below 1. Write a function called swap that takes a string and two integers and swaps the letters found at the locations of the two letters. The locations of the letters is calculated starting at one. The new string should be returned. 3 7 Input: Output: I am boggled! I om baggled! 2. Write a function called uncompress that takes a string comprised of combinations of integers followed by letters. The integer represents the number of instances of the character that follows that should be in the final string. You should return the uncompressed string. Input: 1mli2sli2sli2pli = zyBooks & 0 , 2. Write a function called uncompress that takes a string comprised of combinations of integers followed by letters. The integer represents the number of instances of the character that follows that should be in the final string. You should return the uncompressed string. Input: 1mli2sli2sli2pli Output: mississippi 3. Write a function called longestword that takes a string of compressed words (as in number 2). The function should use the uncompress function to uncompress each of the words contained in the string. The function should print the longest word and the length of the longest word. Input: 1mli2sli2sli2pli 1b12olg10e 5a2h Output: boooo000000oogeeeeeeeeee 24 = zyBooks G O 3. Write a function called longestword that takes a string of compressed words (as in number 2). The function should use the uncompress function to uncompress each of the words contained in the string. The function should print the longest word and the length of the longest word. Input: 1mli2 sli2 sli2pli 1b12olg10e 5a2h Output: boooooooooooogeeeeeeeeee 24 4. You are to write a function that takes a real-word word or phrase and inserts gibberish in order to generate a password. The function must be called gen_password and it must take a string representing the real-world word or phrase and a string of 2-3 gibberish characters. You must return a password that is the original word or phrase = zyBooks @ @ 0. 4. You are to write a function that takes a real-word word or phrase and inserts gibberish in order to generate a password. The function must be called gen_password and it must take a string representing the real-world word or phrase and a string of 2-3 gibberish characters. You must return a password that is the original word or phrase reversed and the vowels in the original word replaced with the gibberish characters. Input: "thataway", "*!" Output: y*!*!t*!ht In order to test, you must include your test code at the end of the file within the section: if __name__ == '__main__': This section should only test the longestword function. The rest of the functions will be tested via unit tests. ACTIVITY 8.20.1: Homework 6 - Strings and List

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!