Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Guess my number. Write a robust program that randomly selects a number 1through 100 and asks the user to guess the number. At each guess

Guess my number. Write a robust program that randomly selects a number 1through 100 and asks the user to guess the number. At each guess the user should be told if the guess is proper, and if so, whether it is too high or too low. The user should be told of the number of guesses when finally guessing the correct number. Please complete in notepad++ then save in .py Complete your program design(flow chart, Pseudocode,or other). Save the finished project as a .pyfile import random ran_num = random.randint(1,101) print(ran_num) user_guess = int(input("Enter a number between 1 and 100 : ")) guess_count = 1 while user_guess != ran_num: if user_guess > ran_num: print("user guess is too high ") if user_guess < ran_num: print("user guess is too low") guess_count += 1 user_guess = int(input("Again enter a number between 1 and 100 :")) print("total no of guess count",guess_count) This program will not run properly. Keeps giving and error message=expected an indented block import random ran_num = random.randint(1,101) print(ran_num) user_guess = int(input("Enter a number between 1 and 100 : ")) guess_count = 1 while user_guess != ran_num: if user_guess > ran_num: print("user guess is too high ") if user_guess < ran_num: print("user guess is too low") guess_count += 1 user_guess = int(input("Again enter a number between 1 and 100 :")) print("total no of guess count",guess_count) Even after putting proper spacing it is still not running properly. I am eager to getting it running asap. I dont understand the spacing issue as well. I am missing something this program isnt running properly.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago