Nov-09-2020, 12:31 AM
What i am trying to do:
create a inventory item that uses a function.
The code doesn't work but i will include it as it shows the function i am trying to call on as a list item.
create a inventory item that uses a function.
The code doesn't work but i will include it as it shows the function i am trying to call on as a list item.
def hall(): inv=[] name='' name=input('enter name') print('you found an item') inv+=trophy(name) return name,inv def show(inv): print(inv) def trophy(name): sym='.' for i in range(1, len(name)+5, 1): print (sym, end="") print("\n.."+str(name)+"..") for i in range(1, len(name)+5, 1): print (sym, end="") def main(): name,inv=hall() show(inv) trophy(name) main()