Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python

Please Help me solve this question. It has to be done in Python Language. Please Don't use advanced python and solve it using basic python like functions, lists, tuples, dictionaries, strings, etc.image text in transcribed

Question 4. The goal of this game is for the user (player) to guess the 5 character word in a limited number of chances. Pick up at least 505 character words (e.g. from https://7esl.com/5-letter-words/ ) and save them in a list or any other structure (you can assign them in a statement, i.e. hard code them). Select a word at random from this list - for this, generate a random number between 0 and length of the list of words using the random number generator randint() provided in python (PIs look it up it is quite easy) - this is the index in the list for the word the user has to guess. Now prompt the user to input a five character string as his/her guess. After the guess, the program should show the user the chars from the guess string which are in correct places, and correct chars in wrong places, by outputting: -a-d (if a and d were in the input string and are in these two places in the word), other characters present: b (if b is present in the word) Let the user repeatedly give guesses, till either the guess is correct, or the number of tries is 6 . Bonus: Accept from the user only valid words as guesses. For this, use an available online dictionary API to check if the given string is a word or not. And if not, prompt the user and do not count this attempt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logidata+ Deductive Databases With Complex Objects Lncs 701

Authors: Paolo Atzeni

1st Edition

354056974X, 978-3540569749

More Books

Students also viewed these Databases questions