Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having an issue with this code and can't figure out why its telling me the number I need to guess. take a look at the

Having an issue with this code and can't figure out why its telling me the number I need to guess. take a look at the output, after the 2 attempt, the programs tells me the # i need to guess even if I get it wrong.

image text in transcribed

image text in transcribed

FIPRO ErC Assignment 8B Guessing game.py - C:/Users/Icand/Documents/Valencia College/Spring Semester 2021/Intro to Progra... File Edit Format Run Options Window Help La 7 10 11 12 13 14 15 16 17 # import random module import random #generate random number from 1 to 100 num = random.randint (1,100) 18 #print welcome message print ("Welcome to the number guessing game!!") print("You will have 10 tries to guess a secret number between 1 and 100") SC #define tries and no_of_count tries = 1 no_of_count =1 OC #prompt user to enter guess print(("Enter your guess () of 10: "). format (no_of_count)) user_input = int (input()) #define while loop which runs till tries is less than 10 and user_input not equal to num while(tries100): user_input = int(input ("The guess is out of range. Please enter the guess again: ")) #if player guess more than number if user_input>num: print ("You guessed too high, please guess lower") #if player guess less than number elif user_input

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

Step: 3

blur-text-image

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

Assemble short, logical paragraphs

Answered: 1 week ago