Hello,
My sellPrice variable won't work because it's taking price as a string and trying to multiply it to a number.
[price = int(input("Item Price $: "))]
But I get:
(It's probably a quick fix, but I'm drawing a blank right now)
Thanks in advance.
The code right now:
My sellPrice variable won't work because it's taking price as a string and trying to multiply it to a number.
Error: File "ListTest.py", line 10, in <module>
sellPrice = price * 1.10
TypeError: can't multiply sequence by non-int of type 'float'
I tried forcing the price to be an int [price = int(input("Item Price $: "))]
But I get:
Error:Traceback (most recent call last):
File "ListTest.py", line 18, in <module>
"Price: $" + price,
TypeError: can only concatenate str (not "int") to str
How do I get this to work?(It's probably a quick fix, but I'm drawing a blank right now)
Thanks in advance.
The code right now:
#Store items and related info in a list #Create an empty list Item = [] #Elements for the list name = (input("Item Name: ")) quantity = (input("Item Quantity: ")) price = (input("Item Price $: ")) sellPrice = price * 1.10 ItemInfo = ("Name: " + name, "Quantity: " + quantity, "Price: $" + price, "Sell Price: $" + sellPrice) Item.append(ItemInfo) #Appened the ItemInfo to the Item list print(Item) #Print the list