Question: finish recursive python3 program? the program uses a recursive function to scramble a string and print out all of the possibilities. The question marks indicates

finish recursive python3 program? finish recursive python3 program? the program uses a recursive function to scramble

the program uses a recursive function to scramble a string and print out all of the possibilities. The question marks indicates places where the code needs to be finished. Comments should help with what needs to be there. Sample output is shown. a string and print out all of the possibilities. The question marks

def scramble(currentScramble, lettersLeft): # base case if ??? # prints out print(???) variable to see result # recursive case else: # for each letter available for scramble for i in range(len lettersLeft)): letter lettersLeftli] # creates a copy of the string without that letter while 1 TenC1ettersLeft): newlettersLeft lettersLeftil + lettersLefti+1:7 # set past the end of string to exit loop = len(letterseft) # add letter removed from lettersLeft to current scrambled word newScramble-2?? # recursive call def mainQ: print("Welcome to scrambler!") word inputC" Please enter a string to scramble:") # call recursive function. scramble() takes in currentScramble, lettersLeft print("Thank you for using the scrambler!n") main) def scramble(currentScramble, lettersLeft): # base case if ??? # prints out print(???) variable to see result # recursive case else: # for each letter available for scramble for i in range(len lettersLeft)): letter lettersLeftli] # creates a copy of the string without that letter while 1 TenC1ettersLeft): newlettersLeft lettersLeftil + lettersLefti+1:7 # set past the end of string to exit loop = len(letterseft) # add letter removed from lettersLeft to current scrambled word newScramble-2?? # recursive call def mainQ: print("Welcome to scrambler!") word inputC" Please enter a string to scramble:") # call recursive function. scramble() takes in currentScramble, lettersLeft print("Thank you for using the scrambler!n") main)

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!