Question: python programming Exercise 1: Write a python method that will choose a word, shuffle the characters, and then ask the user to guess the word.
Exercise 1: Write a python method that will choose a word, shuffle the characters, and then ask the user to guess the word. You can follow the order of these comments: #Initialize a list of words (Ex: mywords=loxygen", "spark", "fire"]) #choose a random number that will represent the index of the word we are making the user guess (Ex: rl=random randint(a,b) It will choose a random integer between a and b (b) included) (Don't forget to import random) To tum a string into a list we use the following command, mystringlist=list(string) +Turn the string into a list To shuffle a list, we use the following commandi random shuffleomis e shuffle the characters and print the combination = ask the user to guess the word = if the word is correct print. Congratulation you guessed correctly else print The guess is wrong, better luck next time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
