Skip to main content

Fixing Errors (1)

Try running the program below:

print "Altoira Peto''

There will be a number of errors that are detected when the program runs.

The ones here are called syntax errors as they are due to the errors being due to the text we have used in our code.

These are different to logic errors which the code will run but not work correctly.

The file above is missing the ( ) for the print function and the string has a mix of " and '. There should be two of the same.

print("Altoira Peto")

Create a new file ex_errors.py and fix the code below

Print("Hello Mercury")
print('Hello Venus')
print("Hello Earth')
print "Hello Mars"
print("Hello", "Jupiter')
print("Hello" "Saturn")
prnit("Hello Neptune")