Ex25 Line29 NameError

When I am typing the commands out, they all seem to work fine except


I get an error
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\hp\lpthw\ex25.py”, line 29, in print_first_and_last
NameError: name ‘print_last_words’ is not defined

Without looking at your code, it’s hard to figure out what is going wrong. Compare the function you’re trying to call with the function being called, in this case “print_last_words”. Based on my file, the function is called “print_last_word”, not “words”. Let me know if this works!

1 Like