Python Forum
Please Help with My First Python Attempt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please Help with My First Python Attempt
#4
Write a program to simulate a simple guessing number game, specify how many guesses the user can do

You don't do this. For this you will want to use a loop, a while loop that counts each guess or a for loop with a range. Something like these:
number_of_guesses = 0
while number_of_guesses > 5:
    """game code goes here"""
    number_of_guesses += 1
 
or

for guess in range(5):
    """game code goes here"""
      
Then it prints out Cold if his/her guess is greater or smaller than 40% of the answer, and print HOT if its within 10%.

This is some arithmetic that is part of your assignment. Your code doesn't use percentages at all. You'll need to find 40% and 10% of the answer and the difference between the guess and the answer.
Reply


Messages In This Thread
RE: Please Help with My First Python Attempt - by michael1789 - Feb-15-2020, 08:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Please Help with My First Python Attempt saigwe 2 5,023 Jan-12-2021, 08:01 AM
Last Post: Safa999

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020