8 Errors

Syntax Errors

Errors with spelling, misuse of capital letters or omitting important language features. These are picked up by the IDE and when run in debugging mode the program won’t finish and will report the errors

1
2
3
4
5
6
7
8
#correct code
username=input("What is your username?")
password=input("What is your password?")

if username=="admin" and password=="Hello12":
    print("Authenticated")
else:
    print("Not authenticated")

You can use the correct code above to help spot the syntax errors below

Logic Errors

When a program runs but doesn’t do what the programmer intended because of human error. These can be difficult to spot.

Tracing Tables for Testing

As logic errors are difficult to find as the program runs you can create a tracing table to spot errors as below