Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,205,614 members, 7,993,087 topics. Date: Monday, 04 November 2024 at 05:41 AM

Andela: IT Training And Job - Jobs/Vacancies (133) - Nairaland

Nairaland Forum / Nairaland / General / Jobs/Vacancies / Andela: IT Training And Job (642589 Views)

Letter To All Fresh Graduates and Job seekers / Andela: IT Training And Job - Jobs/vacancies / Similarities Between Football And Job (2) (3) (4)

(1) (2) (3) ... (130) (131) (132) (133) (134) (135) (136) ... (263) (Reply) (Go Down)

Re: Andela: IT Training And Job by voltz(m): 8:46pm On Apr 08, 2017
noordean:

LOL
say, how long does it take for the interview invite after one completes the test?
Re: Andela: IT Training And Job by gudchyld: 9:12pm On Apr 08, 2017
guys, study this error carefully, this is where the shoppingCart solution lies.....You have to be able to remove item completely....It's been said before, but its funnily tough

[img][/img]

Re: Andela: IT Training And Job by Nobody: 12:38pm On Apr 09, 2017
ymee:
I beg make una help me out o time dey go. here is my problem

HST2: OBJECT ORIENTED PROGRAMMING LAB

Create a class called ShoppingCart.

Create a constructor that takes no arguments and sets the total attribute to zero, and initializes an empty dict attribute named items.

Create a method add_item that requires item_name, quantity and price arguments. This method should add the cost of the added items to the current value of total. It should also add an entry to the items dict such that the key is the item_name and the value is the quantity of the item.

Create a method remove_item that requires similar arguments as add_item. It should remove items that have been added to the shopping cart and are not required. This method should deduct the cost of the removed items from the current total and also update the items dict accordingly.

If the quantity of an item to be removed exceeds the current quantity of that item in the cart, assume that all entries of that item are to be removed.

Create a method checkout that takes in cash_paid and returns the value of balance from the payment. If cash_paid is not enough to cover the total, return "Cash paid not enough".

Create a class called Shop that has a constructor which takes no arguments and initializes an attribute called quantity at 100.

Make sure Shop inherits from ShoppingCart.

In the Shop class, override the remove_item method, such that calling Shop's remove_item with no arguments decrements quantity by one.
Re: Andela: IT Training And Job by voltz(m): 12:53pm On Apr 09, 2017
[quote author=ymee post=55406572][/quote]

what error are you getting?
Re: Andela: IT Training And Job by voltz(m): 12:54pm On Apr 09, 2017
What error are you getting?
Re: Andela: IT Training And Job by gudchyld: 2:14pm On Apr 09, 2017
@voltz.....Its the keyerror(mango,) thingy

my guess it has to do with removing items completely...I dont reaaly know how
Re: Andela: IT Training And Job by voltz(m): 2:29pm On Apr 09, 2017
gudchyld:
@voltz.....Its the keyerror(mango,) thingy

my guess it has to do with removing items completely...I dont reaaly know how

have you tried 'del self.items[item_name]' if 'quantity' is greater than 'self.items[item_name]'
Re: Andela: IT Training And Job by gudchyld: 2:45pm On Apr 09, 2017
Yeah tried that.........

@voltz....Im guessing you re done with the shopping cart...please would love to mail you, here is mine goodchild66@gmail.com
Re: Andela: IT Training And Job by Nobody: 3:01pm On Apr 09, 2017
voltz:
What error are you getting?
I just PMed u pls reply so as to communicate on whatsapp thanks
Re: Andela: IT Training And Job by voltz(m): 3:25pm On Apr 09, 2017
add_item:
add total price of quantity to total instance variable
if the item is in the dict
then add quantity to the value of the item in the list.
else add item to the dict with value as quantity

remove_item:
if item is in the dictionary then:
***if quantity > items[item_name] then
deduct (price * item[item_name]) from total
delete item from dictionary
***else deduct (price * quantity) from total
deduct quantity from item[item_name]
Re: Andela: IT Training And Job by gudchyld: 4:37pm On Apr 09, 2017
voltz:
add_item:
add total price of quantity to total instance variable
if the item is in the dict
then add quantity to the value of the item in the list.
else add item to the dict with value as quantity

remove_item:
if item is in the dictionary then:
***if quantity > items[item_name] then
deduct (price * item[item_name]) from total
delete item from dictionary
***else deduct (price * quantity) from total
deduct quantity from item[item_name]


@Voltz........Working algorithm...U the man!!

1 Like

Re: Andela: IT Training And Job by gudchyld: 10:52pm On Apr 09, 2017
Yeah!!! 100% completed.................okay bring it on
Re: Andela: IT Training And Job by voltz(m): 11:54pm On Apr 09, 2017
gudchyld:
Yeah!!! 100% completed.................okay bring it on
Nice and extra time to spare!
Re: Andela: IT Training And Job by noordean(m): 11:59pm On Apr 09, 2017
voltz:
say, how long does it take for the interview invite after one completes the test?
few days after the test's deadline
Re: Andela: IT Training And Job by OSI7: 1:51am On Apr 11, 2017
voltz:

Nice and extra time to spare!
please am having issues with shopping cart's hidden test. I've tried to raise type errors if the type of any of the arguments is false still no avail. All visible tests passed though. Any help will be greatly appreciated cry
Re: Andela: IT Training And Job by OSI7: 1:52am On Apr 11, 2017
gudchyld:
Yeah!!! 100% completed.................okay bring it on
Havin issues with shopping cart's hidden test. Tips ?
Re: Andela: IT Training And Job by voltz(m): 8:05pm On Apr 11, 2017
OSI7:

Havin issues with shopping cart's hidden test. Tips ?
still need help?
Re: Andela: IT Training And Job by kemus: 10:38am On Apr 12, 2017
voltz:

still need help?

Please having same issues. Would appreciate some help

class ShoppingCart(object):

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

def add_item(self,item_name,quantity,price):

self.items[item_name] = quantity
self.total += price*quantity



def remove_item(self,item_name,quantity,price):
if quantity < self.items[item_name] and quantity >= 0:
self.total -= price*quantity
self.items[item_name] -= quantity
elif quantity >= self.items[item_name] :
del self.items[item_name]

def checkout(self,cash_paid):
if cash_paid >= self.total:
return cash_paid - self.total
else:
return "Cash paid not enough"

class Shop(ShoppingCart):

def __init__(self):
self.quantity = 100

def remove_item(self):
self.quantity -= 1
Re: Andela: IT Training And Job by OSI7: 2:18pm On Apr 12, 2017
kemus:


Please having same issues. Would appreciate some help

class ShoppingCart(object):

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

def add_item(self,item_name,quantity,price):

self.items[item_name] = quantity
self.total += price*quantity



def remove_item(self,item_name,quantity,price):
if quantity < self.items[item_name] and quantity >= 0:
self.total -= price*quantity
self.items[item_name] -= quantity
elif quantity >= self.items[item_name] :
del self.items[item_name]

def checkout(self,cash_paid):
if cash_paid >= self.total:
return cash_paid - self.total
else:
return "Cash paid not enough"

class Shop(ShoppingCart):

def __init__(self):
self.quantity = 100

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

still need help?

Thanks Brother @voltz, not anymore, gudchyld helped me out.
looking thru your code @ kemus
Re: Andela: IT Training And Job by kemus: 3:56pm On Apr 12, 2017
OSI7:


Thanks Brother @voltz, not anymore, gudchyld helped me out. looking thru your code @ kemus
Tanks
Re: 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
Re: Andela: IT Training And Job by phililp(m): 10:56pm On Apr 12, 2017
u all here begging for how to do it... if u cant walk through that test on your own then andela probably isnt a place for you.

aint you guys asking urself how people who did it managed to do it?.... stop begging for anwers. go study well and all this stuffs will be a piece of
shit. if u suceed in bypassing this what will u do in the next phase... i bet u cant do same.

so common mern! for once challenge urself and go upgrade ur skills... take ur time and come back to become a boss... dont beg for how to do it
here.. andela dont need people who cant fix this.

3 Likes

Re: Andela: IT Training And Job by voltz(m): 11:04pm On Apr 12, 2017
phililp:
u all here begging for how to do it... if u cant walk through that test on your own then andela probably isnt a place for you.

aint you guys asking urself how people who did it managed to do it?.... stop begging for anwers. go study well and all this stuffs will be a piece of
shit. if u suceed in bypassing this what will u do in the next phase... i bet u cant do same.

so common mern! for once challenge urself and go upgrade ur skills... take ur time and come back to become a boss... dont beg for how to do it
here.. andela dont need people who cant fix this.
Very true, i read all the 132 pages and i understand the boot-camp is a grinding machine! so if you don't have good problem solving skill right now then you'll be wasting your time and money going to the boot-camp if you're called.
Re: Andela: IT Training And Job by voltz(m): 2:35pm On Apr 13, 2017
Was anyone invited to the Andela Open Slack?
Re: Andela: IT Training And Job by Bahddo(m): 2:58pm On Apr 13, 2017
voltz:

Very true, i read all the 132 pages and i understand the boot-camp is a grinding machine! so if you don't have good problem solving skill right now then you'll be wasting your time and money going to the boot-camp if you're called.
exactly! Some people copy and paste code just to make it to the interviews and then sweet-talk their interviewers, only to struggle badly with first week tasks in the Bootcamp. What's the use?

Bootcamp is even child's play compared with the simulations that one would face in the first 3 months of fellowship.

The truth is that Andela is tough, and it's not a humanitarian organization seeking to teach you stuff just like that. It's a business organization looking for the brightest minds to do their work for them. The earlier one realizes that and works on his skills, the better.

2 Likes

Re: Andela: IT Training And Job by voltz(m): 3:37pm On Apr 13, 2017
Bahddo:
exactly! Some people copy and paste code just to make it to the interviews and then sweet-talk their interviewers, only to struggle badly with first week tasks in the Bootcamp. What's the use?

Bootcamp is even child's play compared with the simulations that one would face in the first 3 months of fellowship.

The truth is that Andela is tough, and it's not a humanitarian organization seeking to teach you stuff just like that. It's a business organization looking for the brightest minds to do their work for them. The earlier one realizes that and works on his skills, the better.

Thanks for the info, now i'm even more excited than ever... it would be boring if it was that easy! smiley smiley smiley

1 Like

Re: Andela: IT Training And Job by phililp(m): 4:43pm On Apr 13, 2017
i even wonder why they said one doesn't need a coding experience to apply...from my observation its either a blunt truth of a fat lie.







by the way; does anybody know how much they pay fellows monthly?

#meanwhile::: am am right here in "learnpyhon.org" still fixing myself for the next application.. anyone have ideas when it'll start??
Re: Andela: IT Training And Job by voltz(m): 10:15am On Apr 14, 2017
phililp:
i even wonder why they said one doesn't need a coding experience to apply...from my observation its either a blunt truth of a fat lie.







by the way; does anybody know how much they pay fellows monthly?

#meanwhile::: am am right here in "learnpyhon.org" still fixing myself for the next application.. anyone have ideas when it'll start??

deadline for application is 5th may
Re: 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......
Re: Andela: IT Training And Job by voltz(m): 2:44pm On Apr 14, 2017
kposedaddy:
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

######### CHANGES MADE ###############
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):
# changed
if item_name in self.ltems:
self.items[item_name] += quantity
else:
self.items[item_name] = quantity
cost = quantity * price
self.total = (self.total + 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:
# changed
self.items[item_name] -= quantity

def checkout(self, cash_paid):
# changed
if cash_paid < self.total:
return "Cash paid not enough"
else:
return cash_paid - self.total

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

def remove_item(self):
# changed
self.quantity -= 1


ASSISTED......
Re: Andela: IT Training And Job by gudchyld: 11:24pm On Apr 14, 2017
voltz:
[/quote][quote author=kposedaddy post=55563963]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......

Hey use @Voltz algorithm..... If u r still stuck... Mail me.... In ur add method, try moving the total expression to the top of ur method

Then in ur remove method.... First check weda the item u r abt to remove is olredy in d cart
Re: Andela: IT Training And Job by Nobody: 1:02pm On Apr 15, 2017

(1) (2) (3) ... (130) (131) (132) (133) (134) (135) (136) ... (263) (Reply)

How To Apply For Nigeria Immigration Service (NIS) Recruitment 2017 / Federal Road Safety Commission 2018 Recruitment: How To Apply / FIRS To Recruit 1,250 New Staff

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 49
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.