Question: Python problem. The user think about a 3-digit number and the computer problem should be able to guess. After each guess, the user should give
Python problem. The user think about a 3-digit number and the computer problem should be able to guess. After each guess, the user should give feedbacks(correct and exact).Correct means the same digit and exact means the correct digit is in the exact position.There are 15 chances to guess.This is the sample run.
Guess 1/15: 123 How many correct digits? 0 Guess 1/15: 123 Correct-0 Exact-0 Guess 2/15: 490 How many correct digits? 1 How many exact digits? 1 Guess 1/15: 123 Correct-0 Exact-0 Guess 2/15: 490 Correct-1 Exact-1 Guess 3/15: 478 How many correct digits? 3 How many exact digits? 1 Guess 1/15: 123 Correct-0 Exact-0 Guess 2/15: 490 Correct 1 Exact-1 Guess 3/15: 478 Correct-3 Exact-1 Guess 4/15: 487 How many correct digits? 3 How many exact digits? 3 Congratulations!! Start a new game (y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
