Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I want to be able to print out the name, quantity, item and price but format isn't working. class HousemateHelper: def __init__(self): pass def addPurchase(self,Name=input(What
I want to be able to print out the name, quantity, item and price but "format" isn't working.
class HousemateHelper: def __init__(self): pass def addPurchase(self,Name=input("What is your name:"),Item=input("What did you buy:"),Quantity=input("How much did you buy:"),Cost=float(input("How much was the cost:"))): self.name= Name self.item=Item self.quatity=Quantity self.cost=Cost print("{},{},{} and {}".format(self.name,self.item,self.quantity.self.cost))
#def getInventory(self,items):
f= HousemateHelper()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started