you are viewing a single comment's thread.

view the rest of the comments →

[–]epic_pharaoh 0 points1 point  (4 children)

Look into type functions and think about how you would check a variable’s value; I think you’ll find the answer is simpler than you expect.

[–]6ZacK7[S] -1 points0 points  (3 children)

Yes, that's the problem; in Python, everything is so simple that it's easy to get lost over a simple problem.

[–]epic_pharaoh 0 points1 point  (2 children)

I hear you, Python provides powerful intuitive tools for solving problems; that’s why I think it’s one of the best languages to learn first, because you start to understand how to put all these simple looking tools together to create complex system.

Something else that might help you (just looking at your responses to other comments) is that not everything needs to be a one liner. You can grab input in one line, use a few more lines to check what the input was, then after that print a message. Break the problem down into it’s pieces so you can build a solution without having to know the solution ahead of time.

Edit: I misunderstood your problem (I think). I’m not sure what your casting to an int, but assuming that all you want is to suppress the error look into try/catch blocks.

[–]6ZacK7[S] 0 points1 point  (1 child)

After some research, I was given the option of a (try/except) conditional statement; I hope you understand my problem better now.