I am trying to draft a python script to guess a random number…

Question Answered step-by-step I am trying to draft a python script to guess a random number… I am trying to draft a python script to guess a random number between 1 and 10.  The game is supposed to ask the player their name and then ask for the number and keep asking till the correct number has been asked.  The game will tell the player the correct number and the number of tries it took to be successful.  The game will also ask the player if they wanted to restart the game or quit and also display the scoreboard.  I am having trouble getting the game to restart.  Here is my script so far.  Can someone tell me where I’m going wrong? import randomprint(“Please enter your first name: “)name = input()print(“Hello ” + name + “!!!”) print(“Welcome to ‘Guess My Number’!”)print(“Please guess a number between 1 and 10……”)print(“Try to guess it in as few attempts as possible.n”)the_number = random.randint(1, 10)guess = int(input(“Please guess a number between 1 and 10: “))tries = 1while guess != the_number:   if guess > the_number:       print(“You guessed too high…”)   else:       print(“You guessed too low…”)   guess = int(input(“Please guess a number between 1 and 10: “))   tries += 1print(“Congratulations ” + name + “!!! You guessed the right number! The number was “, the_number)print(“You guessed the number in “, tries, ” tries!n”)restart = input(“Should I start another game? (Yes or No?): “)if restart == “Yes”:   print(“Starting a new game….”)else:   print(“Thanks for playing”) #question = input(“Should I start another game? (Yes or No?)”)#while question == “Yes” or question == “No”:   #if question == “Yes”:       #print(f”Starting new game”)   #else:       #print(“End of game.”)       #breakprint(“******Score Board******”)print(“———————–“)print(“******Player Score*****”)print(“———————–“)scores = {}scores[name] = triesprint(scores)  Here is what happens when I run my program: “Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32Type “help”, “copyright”, “credits” or “license()” for more information.>>> = RESTART: C:Userskimmoo1642DocumentsCIS123Week2GP2.7 Performance Assessment Newest Try.pyPlease enter your first name: KimberlyHello Kimberly!!!Welcome to ‘Guess My Number’!Please guess a number between 1 and 10……Try to guess it in as few attempts as possible.Please guess a number between 1 and 10: 1You guessed too low…Please guess a number between 1 and 10: 10You guessed too high…Please guess a number between 1 and 10: 6You guessed too low…Please guess a number between 1 and 10: 9Congratulations Kimberly!!! You guessed the right number! The number was  9You guessed the number in  4  tries!Should I start another game? (Yes or No?): YesStarting a new game….******Score Board******———————–******Player Score*****———————–{‘Kimberly’: 4}” Computer Science Engineering & Technology Python Programming CIS 123 Share QuestionEmailCopy link Comments (0)