In article <slrnrt9neo.40a.bisch...@vimart.net>, Bischoop <bisch...@gemail.com> wrote: > >I need to check if input number is 1-5. Whatever I try it's not working. >Here are my aproaches to the problem: https://bpa.st/H62A > >What I'm doing wrong and how I should do it?
You need to learn about types. ;-) Input returns a string. That string is not in the range you compare it to. You need to convert it to an int: choice = int(input.. ) This is assuming you want a whole number. You compare it against the list of numbers [1, 2, 3, 4, 5]. If 2.4 is also a valid number, you need a different comparison. 2.4 is not in this list. So first you should get your requirements straight.. ;-) -- [J|O|R] <- .signature.gz -- https://mail.python.org/mailman/listinfo/python-list