Jan-19-2018, 09:58 PM
(Jan-19-2018, 08:51 PM)Thethispointer Wrote:(Jan-19-2018, 08:49 PM)j.crater Wrote: The thing is thatx = input()
makes x variable of type string. So when you comparex == y
, you are comparing strings and integers, which will always return false. So you either need to make items in your list strings as well, or cast string to integer upon entering number, like this:
x = int(input())
Ah I see, tricky little line.TY!
If unsure in such situations, you can use
type(x)
, and it will print type of x. Pretty handy with debugging!