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
areashould equal to50 - The program should print the message
The area of the square is 50
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules