Question: python help please The goal of this exercise is to write a function shufflestring with a parameter text, that returns a permutation of text, which
The goal of this exercise is to write a function shufflestring with a parameter text, that returns a permutation of text, which means the letters of text are returned in a different order. The built-in function random. shuffle() does something similar, but you basically have to write your own version of it, so you are forbidden to use random. shuffle. Other functions from the random module would be useful of course, such as random. randrange ( ) or random. randint ( ). Optional: It could be easier to start by a function that shuffles a list, then use the function shuffleList to shuffle the indices of the string. Don't forget docstrings! To check that your function works well, run it several times on the same input and check that you get different results each time, as per the below sample runs: >> shufflestring("programming") 'miargpmngor' >> shufflestring("programming") 'rimmogprgan
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
