Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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. 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
python programming
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started