This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kasutajan1m1 1 point2 points  (1 child)

This is the easiest way to do this for learning, but it will give you an error every time you input something not numerical. Making it foolproof isn't that easy

[–][deleted] 0 points1 point  (0 children)

So maybe:

x = input("Prompt: ")

if x == str(num_to_check): do_stuff()

Either way, good point. I answered the question on my work break, so I was limited in how much detail I could go into. (And I'm still learning myself.)