# Kwiki Mart

def main():
    
    myStore = createStore()
    
    choice = getMenuChoice()
    while choice != "0":
        if choice == "1":
            listItems(myStore)
        elif choice == "2":
            restock(myStore)
        elif choice == "3":
            sellItem(myStore)
        else:
            print("You made an invalid choice, try again.")

        choice = getMenuChoice()

def getMenuChoice():
    print("""
          Welcome to Kwiki Mart!
          What would you like to do?

          0 -- Quit
          1 -- List Remaining items
          2 -- Restock the store
          3 -- Sell an item
          """)
    
    choice = input(">>>")

    return choice

def restock(stock):
    item = input("Whatcha got brotha?")
    price = float(input("Gimme dat price...Foo'!"))
    stock[item] = price
                  
    return stock

def sellItem(store):
    item=input("Wat u buyin'?")
    money=float(input("How much u payin?"))
    change=money-store[item]
    del store[item]
    print("Yo change be $",change, sep="")

def createStore():
    stock={}
    nstock=int(input("How many new items do you want to add?"))
    for i in range(nstock):
        nstock2=input("What do you want to add?")
        price=float(input("How much is it?"))
        stock[nstock2]=price

    return stock

def listItems(Dictionary):
	Items = ""
	Keys = Dictionary.keys()
	Values = Dictionary.values()
	for Key in Keys:
		print(Key, " ", "$", Dictionary[Key], sep="")
    
    



main()
