Answered step by step
Verified Expert Solution
Question
1 Approved Answer
what if i wanted to add the end product of this import part class Supplier: def _ _ init _ _ ( self , name
what if i wanted to add the end product of this import part
class Supplier:
def initself name:
self.namename
self.part
def addpartself name, price:
self.parts.appendpartPartnameprice
def getpriceself part:
def partexistsself part: to import database
import supplier
supplierdatabase database.Database
while True:
data inputEnter supplier name, or quit to exit:
if data "quit":
break
s supplier.Supplierdata
printPart info should be entered in the following format: name, price"
while True:
partinfo inputEnter part info, or quit to exit:
if partinfo "quit":
print
break
try:
name, price partinfo.split
price floatprice
except:
printError input Part info should be entered in the following format: name, price please try again"
continue
saddpartname price
supplierdatabase.addsuppliers
print
Supplier database complete!
while True:
data inputPlease enter in a part name or quit to exit:
if data "quit":
break
supplier, price supplierdatabase.findpartdata
if supplier False:
printError part does not exist in database"
else:
printfPart data is available for the best price at supplier Price: $price:f
print
Thank you for using the price database!" without modifying the code i dont want to add impoort part under import database, import supplier that code should be unchanged
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