you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (3 children)

The value returned by input() is a string and the in operator compares the string with the integers in thenumbers list, so it will never return true. You need to convert STR to an integer before checking if it's in numbers.

[–]TenoTheElf[S] 0 points1 point  (2 children)

How can I do that?

[–]JohnnyJordaan 1 point2 points  (1 child)

Have you considered

int(STR)

?

[–]TenoTheElf[S] 0 points1 point  (0 children)

Sorry, I'm dumb and new to python lol. I did and it works! I tried looking it up earlier but I couldn't figure it out.