This looks like a job for.. help needed


#1

Hey guys :slight_smile:

I need a fresh pair of eyes on this. I'm pretty sure I've got this code right but I keep getting the message:
Oops, try again. Did you create an instance of the PartTimeEmployee class called milton?


#2

Which part of your code would you say does that?
I see nothing mentioning milton. If you post it as text instead of a png then it'd be possible to search in it (and run it)


#3

It says to create an instance of Milton for PartTimeEmployee which is what I did in line 17 and called it to print in line 18. At least I think what I did is what it asked


#4
class Employee(object): 
    
    def __init__(self, employee_name):
            self.employee_name = employee_name

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

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(hours)

p_t_employee = PartTimeEmployee("milton")
print p_t_employee.full_time_wage(4)

#5

I see "milton" now.

Anyway, the instructions somewhat vaguely suggest creating a variable milton


#6

yeah I got it now.. the instance is meant to be named milton and then you give it some name in the attributes. The Instruction were a bit vague.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.