0
How to improve my code
7 odpowiedzi
+ 2
Cbr✔[ Exams ]
if count == 9:
print("Your number is", 1)
...
OR
for i in range(1,10):
if count == i:
print("Your number is", 10-i)
break
+ 2
You can use a for loop. Here's a sample, you'll have to complete the "guesses" list.
guesses = [[[1,2],[4,5]],[[3,6],[7,8]]]
for lst in guesses:
print ("Check whether your guessed number is in the list\n")
print (lst)
print("If your guessed number is in the above list type")
x = input("yes or no\n")
if x == 'yes' :
count+=1
...
+ 1
https://code.sololearn.com/cCetUduD1isv/?ref=app
Now this is not working as expected Diego
0
Błack Jesus❕but I want the user to guess a number. Any tricks for that