Question: Using Python, write a function scramble(word) that constructs a scrambled version of a given word, randomly flipping two characters other than the first and last

Using Python, write a function scramble(word) that constructs a scrambled version of a given word, randomly flipping two characters other than the first and last one. Test this function for several words of different lengths.

Write a second function build sentence(string) that will accept a string containing an entire sentence. Design your function to use scramble(word) from the previous step to construct your own transposed sentence similar to the example. The function build sentence(string) should return a string containing the full sentence where the letters of each word have been scrambled by scramble(word).

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!