Untitled
unknown
plain_text
2 years ago
400 B
7
Indexable
import random
input("Think of a number between 0 and 100. Press enter when ready.")
upperBound=100
response=0
lowerBound=0
while response!="yes":
guess=round((upperBound+lowerBound)/2)
response= input(str(f"Is it {guess}? If it's not {guess}, is it higher or lower?: "))
if response=="lower":
upperBound=guess
elif response=="higher":
lowerBound=guess
Editor is loading...
Leave a Comment