51.4k views
3 votes
When you are trying to anticipate user errors, which do you think is better to use—an if else statement or a try except statement? Why? Can you think of a rule that you could follow to determine which you should use?

User GHP
by
7.7k points

1 Answer

10 votes

Answer:

try except

Step-by-step explanation:

You shouldn't use an if else statement for anticipating user errors since try-except was made for executing statements until encountering an error, while if-else is checking for a condition and if its not met, it will do an else.

User Ikh
by
8.7k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.