| Error Message | Likely Cause | Fix | |---------------|--------------|-----| | IndexError: list index out of range | Using incorrect loop range | Ensure while i < len(list) , not <= | | NameError: name 'x' is not defined | Variable scope issue inside function | Return the value, don't rely on global | | Code Avengers: "Did you forget to convert to int?" | Missing int() around input() | Use variable = int(input(...)) | | AssertionError: Wrong output format | Extra spaces, missing newlines, or wrong case | Match expected output exactly |
The course is designed to build on the basics from Python 1: code avengers answers python 2 new
def square(num): return num ** 2
items = ["apple", "banana", "orange"] quantities = [0, 5, 12] | Error Message | Likely Cause | Fix