Fixing syntax errors

[vocab] syntax | function | input

M. Lim
Intro to Programming
2 min readJan 16, 2018

--

Click here for activity

Background

Coding languages have their own syntax, aka: rules and grammar, just like English or Spanish. Unlike people, computers are terrible at interpreting anything that doesn’t follow the exact syntax. Anything that doesn’t follow the exact syntax will produce an error.

Syntax of a FUNCTION:

  • A function is something that a language knows how to do. print() is a function that comes built-in with Python. A function takes an input, and transforms it into an output.

Another example, where the input contains integers instead of a string:

Common syntax errors:

Unmatched delimiters

  • aka: parentheses (), brackets [], braces {}, or quotes " " that are missing its matching pair!

Spelling errors

  • If the spelling is off by even one letter, the computer will think you’re calling a different function that it doesn’t know how to do.
computer: “wtf is prnt?”

--

--