₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,342 members, 8,421,427 topics. Date: Saturday, 06 June 2026 at 12:13 PM

Toggle theme

Kposedaddy's Posts

Nairaland ForumKposedaddy's ProfileKposedaddy's Posts

1 (of 1 pages)

Jobs/VacanciesRe: Andela: IT Training And Job by kposedaddy: 2:08pm On Apr 14, 2017
please i am really stuck and frustrated.....and tomorrow is the deadline...can someone please help me look at this code and tell me what is wrong................this is message it gives me

THERE IS AN ERROR/BUG IN YOUR CODE
Results:


Please re-read the instructions and check your code for non-implemented features.

Make sure to complete all of them before submitting.

Here is the relevant part of the stack trace:

KeyError('Mango',),







This is my code here........

class ShoppingCart(object):
def __init__(self):
self.total = 0
self.items = {}

def add_item(self, item_name, quantity, price):
self.products = self.items[item_name] = quantity
self.cost = quantity * price
self.total = (self.total + self.cost)

def remove_item(self, item_name, quantity, price):
if quantity > self.items[item_name]:
self.total -= (self.items[item_name] * price)
if item_name in self.items:
del self.items[item_name]
else:
self.total -= (quantity * price)
if item_name in self.items:
del self.items[item_name]

def checkout(self, cash_paid):

if cash_paid < self.total:
return "Cash paid not enough"
else:
self.balance = cash_paid - self.total
self.total = 0
self.items = {}
return self.total

class Shop(ShoppingCart):
def __init__(self, quantity=100):
super(Shop, self).__init__()
self.quantity = quantity

def remove_item(self):
self.quantity -= 1
return self.quantity


PLEASE ASSIST......
Jobs/VacanciesRe: Andela: IT Training And Job by kposedaddy: 5:47pm On Apr 12, 2017
gudchyld:
Yeah!!! 100% completed.................okay bring it on
bro please I need help with the oop test. someone should help pls I am running mad...@gudchyld and others that have completed
Jobs/VacanciesRe: Andela: IT Training And Job by kposedaddy: 1:24pm On Mar 16, 2017
Babadee30:
What's the issue you are having?
i am getting the solutions wrong, they dont pass any of the tests
Jobs/VacanciesRe: Andela: IT Training And Job by kposedaddy: 7:59pm On Mar 15, 2017
please has anybody done his data structures and recursive labs? i am stuck and i need understanding of it

please help
Jobs/VacanciesRe: Andela: IT Training And Job by kposedaddy: 3:32pm On Jan 14, 2017
please has anyone received invitation for the interview? cycle xix precisely please has anyone received invitation for the interview? cycle xix precisely please has anyone received invitation for the interview? cycle xix precisely

1 (of 1 pages)