Ok some of you might've seen my post from yesterday about the weekend challenge game thing i'm doing with a friend. The link to my post yesterday is http://www.daniweb.com/software-development/python/threads/416633/1777493#post1777493
Anyway, now im trying to make a shop type thing but im having trouble writing a script (or whatever you call it lol) for buying something from the shop and selling something to the shop. Here's what I have so far but its all messed up and doesn't work.
#go to the shop elif choice == "2": def shop(): print("Welcome to the Shop! We're a little low on supplies right now. Sorry! Here's what we have in stock:") print(shop) buyoption = input("Would you like to purchase something <y/n>: ") if buyoption == "y": def buy(message): item = input("Which item would you like to buy: ") if item == shop[0:1]: shop[0:1] += inventory del shop[0:1]
Your help would be greatly appreciated. I'm still a very beginner so I don't know when to use functions or what to write. Functions confuse me! Lol! I know the code is REALLY MESSED UP but if you could help me solve my many problems lol I'd really appreciate it! Thanks!