Question: in python a. Implement a function create_permutation (n) that creates and returns a list containing a random permutation of the numbers: 0, 1, 2, ...,

in python in python a. Implement a function create_permutation (n) that creates and returns

a. Implement a function create_permutation (n) that creates and returns a list containing a random permutation of the numbers: 0, 1, 2, ..., (n-1) For example, one call to create_permutation (6) could return the list: [3, 2, 5, 4, 0, 1, another call to create permutation (6) could return the list: [2, 0, For more detail on permutation, check this link: https://en wikipedia.org/wiki/Permutation b. Implement a function scramble_word (word) that is given a word (a string), and returns a scrambled version of word, that is new string containing a random reordering of the letters of word. For example, one call to scramble_word('pokemon) could return okonmpe ', another call to scramble_word('pokemon) could return 'mpeoonk Implementation requirement: To determine the new order of the letters, use the function create_permutation (n). For example, for the word 'pokemon ',the scrambled word implied by the permutation [1, 4, 5, 2, 3, 0, 6] is 'omokepn (the first letter is the letter from index 1, the second letter is the letter from index 4, the third letter is the letter from index 5, and so on). c. You are given a text file containing a bank of words (one word in each line). Write a main) function that randomly chooses a word from the file, scrambles it, prints the scrambled word to the user, and allows them to find the unscrambled word 3 times Have your program interact with the user as demonstrated below: Unscramble the word: om okepn Try #1: openkom Wrong! Try #2: pokemon Yay you got it! Notes: 1. Your main should use the function/s you implemented in the previous sections. When printing the letters of the scrambled word, add a space between each two letters. 2

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!