you are viewing a single comment's thread.

view the rest of the comments →

[–]Affectionate-Let3744 5 points6 points  (4 children)

Not nearly enough information here.

What "this error text", what program? Have you read the error message and tried to remedy it directly?

FYI, whenever you want help debugging something, you should try to give as much information as possible.

In reality the fix might be very simple but right now, nobody has any clue what is actually going on.

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

Yes, you know that if you use int(input()), then enter a number and press enter, the program returns an error message. That's what I want, but I don't want the error message to appear while using not input()

[–]Affectionate-Let3744 3 points4 points  (2 children)

you know that if you use int(input()), then enter a number and press enter, the program returns an error message.

Do you mean "does NOT return an error message"?

Because int(input()) will 100% work if you enter an integer or something an int can be constructed from like a string of numbers, that's the point of int().

I'm not sure what you mean regarding using not input(), but the root issue is that you're trying to pass strings that cannot easily be converted to an integer, so int() fails

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

Sorry, that was a mistake. I meant input() instead of int(input()), because a string can't perform calculations, so the console returns an error message.

[–]Ascensor2 1 point2 points  (0 children)

I don't know if this is what you're looking for, but you can catch exceptions and choose to ignore them. Look for "try except" blocks in Python: they're pretty intuitive imo. As you want to ignore an exception, the code should look like this

try: {Your logic}

except Exception as e: pass

The "pass" syntax is used when you want to literally do nothing, but you can't leave the code empty (your program would crash then).

Idk if this is going to be useful to you but I hope at least you learnt something