Using Python, Was doing some stuff when I was doing instructions, weird NameError
occurred while doing this.
My code:
suitcase = ["shirt", "shirt", "pants", "pants", "pajamas", "books"]
# Your code below:
last_two_elements = suitcase[-n:]
print(last_two_elements)
What it gave me:
Traceback (most recent call last):
File "script.py", line 4, in <module>
last_two_elements = suitcase[-n:]
NameError: name 'n' is not defined
I don’t know how to fix this help please.