- Programming is a complex process, and because it is done by human beings, it often leads to errors.
- Programming errors are called bugs and the process of tracking them down and correcting them
is called debugging.
- Use of the term bug to describe small engineering difficulties dates back to at
least 1889, when Thomas Edison had a bug with his phonograph.
- Three kinds of errors can occur in a program: syntax errors, runtime errors, and semantic errors
- It is useful to distinguish between them in order to track them down more quickly.
Python can only execute a program if the program is syntactically correct; otherwise, the process fails and returns an error message.
Syntax refers to the structure of a program and the rules about
- For example, in English, a sentence must begin with a capital letter and end with a period. this sentence contains a syntax error. So does this one
- For most readers, a few syntax errors are not a significant problem, which is why we can read the poetry of E. E. Cummings without problems.
Python is not so forgiving If there is a single syntax
error anywhere in your program, Python will display an error message and quit, and you will not
be able to run your program.
- During the first few weeks of your programming career, you will
probably spend a lot of time tracking down syntax errors.
- As you gain experience, though, you will make fewer errors and find them faster.
- The second type of error is a runtime error, so called because the error does not appear until you run
- These errors are also called exceptions because they usually indicate that something
exceptional (and bad) has happened.
- The third type of error is the semantic error.
- If there is a semantic error in your program, it will
run successfully, in the sense that the computer will not generate any error messages, but it will not
do the right thing.
- It will do something else specifically, it will do what you told it to do.
- The problem is that the program you wrote is not the program you wanted to write.
- The meaning of the program (its semantics) is wrong.
- Identifying semantic errors can be tricky because it requires
you to work backward by looking at the output of the program and trying to figure out what it is
Connect with Me 😊
Once suspended, mahmoudessamelkaruony will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, mahmoudessamelkaruony will be able to comment and publish posts again.
Once unpublished, all posts by mahmoudessamelkaruony will become hidden and only accessible to themselves.
If mahmoudessamelkaruony is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to Mahmoud_Essam.
They can still re-publish the post if they are not suspended.
Thanks for keeping CodeNewbie Community 🌱 safe. Here is what you can do to flag mahmoudessamelkaruony:
Unflagging mahmoudessamelkaruony will restore default visibility to their posts.