0

so I have started with learn python the hard way website and really enjoy it, I was just trying to experiment and have no real purpose of my code. im still having a hard understanding the use of DEF but added it to learn. no matter what number I enter I receive the "not correct" answer. I added the other print statements just to confirm my variables. I know the code is sloppy but just trying to understand the logic of python.


user = 10
def hi():
#    something
#    something
hi.bye = raw_input("print a number ->");

hi()
print ("user is %r") % (user);
print (hi.bye)
if hi.bye < user:
print ("you picked %r") % hi.bye
else:
print("not correct")
kylencr
  • 11
  • 2
  • I do have the indents in my code, this was my first post so learning how to format – kylencr Jan 15 '16 at 00:38
  • You are in urgent need of the [official Python tutorial](https://docs.python.org/2.7/tutorial/index.html), but this particular issue is due to comparing a string with a number. Check the linked duplicate target for details and solutions. – TigerhawkT3 Jan 15 '16 at 00:40
  • Thanks tigerhawk, I did search before posting but only saw a Java post. From the duplicate link I read that using raw_input will only return a string. Also thank you for the link, I have many more hours of studying to do - I have wanted to learn python for years and will keep drilling away. Thank you for being nice on my dimwitted question :) – kylencr Jan 15 '16 at 01:56

0 Answers0