2.1.19

Syntax Errors

Test yourself

Syntax Errors

Syntax errors are some of the easier bugs to fix in a broken program.

Illustrative background for Syntax errorsIllustrative background for Syntax errors ?? "content

Syntax errors

  • A syntax error is a mistake in the way the code is written.
  • It is similar to a spelling or grammar mistake in English.
  • Syntax errors prevent programs from running as a translator needs code to be syntactically correct.
Illustrative background for Example of an errorIllustrative background for Example of an error ?? "content

Example of an error

  • prnt("Hello, world!");
    • Incorrect subroutine identifier.
  • newbalance = newBalance * 1.05;
    • Wrong capitalisation in variable identifier.
  • myBoolean = True NOT False;
    • NOT does not take two operands.

Jump to other topics

1Computational Thinking & Algorithms

2Programming

3Hardware & Software

4Data

5The Internet

6Online Safety & Security

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson