Sample Override Code

Trying to go though some of the python coding on codeacademy.com
http://www.codecademy.com/courses/python-intermediate-en-WL8e4/2/4?curriculum_id=4f89dab3d788890003000096#

class Employee(object):
    """Models real-life employees!"""
    def __init__(self, employee_name):
        self.employee_name = employee_name

    def calculate_wage(self, hours):
        self.hours = hours
        return hours * 20.00

# Add your code below!
class PartTimeEmployee(Employee):
    def calculate_wage(self, hours):
        self.hours = hours
        return hours * 12.00
  
    def full_time_wage(self, hours): 
        return super(PartTimeEmployee, self).calculate_wage(10.00)
milton = PartTimeEmployee("milton")    

Open in new window

When i try to see where the above code takes me, i get

"Oops, try again. milton.full_time_wage(0) returned 200.0 instead of the correct value: 0    " and I'm stuck.
How do i get to 200.00?
xoxomosAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

xoxomosAuthor Commented:
OR how do i format a print statement to print the return of
     super(PartTimeEmployee, self).calculate_wage(10.00)   ?
0
clockwatcherCommented:
Your main problem is that you hard-coded a 10.00 in your call to full_time_wage class.  You should be passing in hours.
def full_time_wage(self, hours):
    return super(PartTimeEmployee, self).calculate_wage(hours)

Open in new window


So no matter what you pass into it, you're going to get 200 back.  The system is complaining that when testing your code It passed a 0 in and got back 200 when it should have got 0 back.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
clockwatcherCommented:
A print statement:
milton = PartTimeEmployee('milton')
print(milton.full_time_wage(10))

Open in new window

0
xoxomosAuthor Commented:
Thanx.  The results print out as expected, but I still get the "Oops, try again. milton.full_time_wage(0) returned 200.0 instead of the correct value: 0" and the codeclinic sends me back to correct?????
0
xoxomosAuthor Commented:
Sorry clockwatcher.  I missed your 'main' point?.  Everything's ok.  Thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.