+ 1
How do I make a shop of technology on Python with the priming of polymorphism and inheritance ?
It is necessary to implement the "Add to cart" functionality for an online store for goods sold: for example, laptops, styluses, tablets. Task: write code using the principle of polymorphism, and make sure that all products can be put in the basket and the site automatically gives the buyer a message every time: "Product so-and-so has been added to the cart."
2 Antworten
+ 4
Cool task!
Have you started it yet? Can you share your code if it isn't working?
https://code.sololearn.com/Wek0V1MyIR2r/?ref=app
https://code.sololearn.com/W0uW3Wks8UBk/?ref=app
https://www.sololearn.com/discuss/138514/?ref=app
https://www.sololearn.com/discuss/93008/?ref=app
https://www.sololearn.com/discuss/9857/?ref=app
https://www.sololearn.com/discuss/1146375/?ref=app
https://www.sololearn.com/discuss/1076326/?ref=app
https://www.sololearn.com/discuss/975961/?ref=app
https://www.sololearn.com/discuss/1754899/?ref=app
https://www.sololearn.com/discuss/1359245/?ref=app
+ 1
No . That's the problem, I do not know how to approach the task. I am creating several classes with the same add_cart method . However , I need to implement adding objects to the cart , while giving the user the opportunity to choose which object and how much to add .