Feb-15-2020, 08:41 PM
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.