Question: What would the pseudocode for this program be? import random import math names=[] score=[] while(True): key=input(Welcome! Press q to quit or any key to continue:)

What would the pseudocode for this program be?

import random import math names=[] score=[] while(True): key=input("Welcome! Press q to quit or any key to continue:") if(key=='q'): break secretNumber=random.randint(10,100) squareRoot=math.sqrt(secretNumber) print(squareRoot," is the square root of what number?",end="") numberOfGuesses=0 while(True): guess=int(input()) numberOfGuesses+=1 if(guess==secretNumber): print("you got it baby! Good game!") break elif(guess>secretNumber): print("too high, guess again:",end="") else: print("too low, guess again:",end="") name=input("What is your name? :") names.append(name) score.append(numberOfGuesses) print()

print(" Top Scores") print("-------------------") for i in range(len(names)): print(names[i],"\t",score[i]) print("-------------------") bestScore=min(score) i=score.index(bestScore) print(" Congratulations, ",names[i]," , you have the best score!") print(" Bye Bye !")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!