Noob question ahead
So I am making a basic text-based RPG just to get me back into the basics of Python after being gone for a few months.
I'm trying to make a function that has all of the items in it as lists, and when the name of an item is called, it returns the 'stats' of the item.
E.g.
def itemlist(input):
item1 = [name, damage, etc]
item2 = [name, damage, etc]
item3 = [name, damage, etc]
...
return(####)
Here I want the return to pass back the item list that has the name of the item in the variable 'input', so this function will be called something like
item = itemlist(item2)
however I get an error saying that 'item2' is not defined in the main() function that I run the request in.
Am I just being an idiot or is there some solution that I'm just missing?