Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

python help please image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building The Data Lakehouse

Authors: Bill Inmon ,Mary Levins ,Ranjeet Srivastava

1st Edition

1634629663, 978-1634629669

More Books

Students also viewed these Databases questions