Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Python script (that is the user interface) which takes the user guesses

ID: 3695345 • Letter: W

Question

Write a Python script (that is the user interface) which takes the user guesses and displays a hint according to the secret number and the guess, until user correctly guesses the secret number. Use A to indicate the bulls and B to indicate the cows. You may assume that the secret number and user guess only contain 4 digits (no alphabet letters or symbols). A sample interaction when the script is run must look like follows. Note: Steps of interface can be given as follows: Import generateSecretNumber, findBulls and findCows functions from PA2_Functions Display the message "Bulls and Cows Game" Generate a 4 digit random number using generateSecretNumber function. Say secret. Get the first guess from user (string value). Say guess. while guess is not equal to the secret do, Call findBulls by passing secret and guess as the arguments and store the return value in a variable. (Say, bulls) Call findCows by passing secret and guess as the arguments and store the return value in a variable. (Say, cows) Display the values of bulls and cows in_A_B format. Get the next guess from user (string value) to guess variable. Display That's it!

Explanation / Answer

Hi below i have given a sample code in python based on your reference, Hope this example method helps you :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote