Editor settings

General settings

Save settings

Learn to program with Python

Errors from misspelling #

One of the most common issues while programming is misspelling your variable names, function names, etc. However, they are easy to spot and debug. If you misspelled something in Python, the program will raise an error NameError with the message name 'something' is not defined.

For example, when you run the code below:

name = "OKAY"
print(names)

You will see below error message:

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    print(names)
NameError: name 'names' is not defined. Did you mean: 'name'?

Exercise #

  • Fix any misspelling in the given code.

Tests #

  • Variable area should equal to 50
  • The program should print the message The area of the square is 50
Output will be displayed here