View the step-by-step solution to:

am confuse where I have to write (is too low or is too high) in python here is my code print("Welcome to my Guess the number program") import random

am confuse where I have to write (is too low or is too high) in python here is my code


print("Welcome to my Guess the number program")

import random


keepGoing = True

#Generate a random number

numberToGuess = random.randint(1,11)

guessess = 0


while (keepGoing):

try:

guess = int(input("Please guess a number between 1 and 10:"))

while guess < 1 or guess > 10:

guess = int(input(("Please guess a number between 1 and 10:"))

except:

print("Numbers Only!")

continue


guesses = guesses +1

if (guess == numberToGuess):

print("You guessed it")

keepGoing = False

else:

print ("Too Low")


print("You guessed it! It took you " + str(guesses) + " attempts")

Top Answer

The desired output for the above code is,             Welcome to my... View the full answer

1.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online