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? 
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. 
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
Get step-by-step solutions from verified subject matter experts
