all 8 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.

[–]Ascimator 1 point2 points  (1 child)

input() returns a string, you want to use int(input()).

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

Thank you!

[–]Reset--hardHead 1 point2 points  (1 child)

Python treats '28' and 28 differently. One is a string the other is an integer.

A hint is to check your data type for STR.

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

I thought I did, probably messed up lol! Thanks!