- 1
Help me with this code
I want to make a number guesser app when I type e.x 62 it's says "put higher" this is wrong please help!!!!!!!!! #play it and then see the code s = int(input("put a number between 1-100:\n")) #to ask user for a number print ("you put",s)#to show to the user what #he/she puts if s == 47: #to configure the right number print ("correct") else: if s >=1 & s <47: print ("put higher") else: if s >47 & s <=100: print ("put lower") what I do wrong?
3 Respuestas
+ 7
You definitely have to correct indentation. Also, you should change & to and, as & is a bitwise operator and might produce funny results. I put 56 as input and it told me to bid higher :)
The rest seems okay, it should work properly.
+ 5
Try to replace "else: if" to "elif".
- 1
thanks so much!!