assignment description: Make a program so that the computer can guess what number the person is thinking of
issue: I'm able to make it so that the code works for numbers 1-10 but not numbers that do not start from 1
I have checked all the values I just think my code is using the wrong formula.
coding issue segment:
issue: I'm able to make it so that the code works for numbers 1-10 but not numbers that do not start from 1
I have checked all the values I just think my code is using the wrong formula.
coding issue segment:
while True: count +=1 mid=((Larger-smaller)//2)+1 print("is your number",mid,"?") guess=input("please put <,>,= based on where you number is from where the number is guessed: ") if guess =="<": Larger=Larger-mid elif guess==">": smaller= smaller+mid else: print("Hooray I got it in ",count," tries!") break
buran write Nov-13-2023, 09:57 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.