attribute error in python

0 votes
i kept getting attribute error in my code. here is my code below

class Employee:

    raise_amt = 1.04

    def __init__(self, first, last, pay):

        self.first = first

        self.last = last

        self.email = first +''+ last + '@company.com'

        self.pay = pay

        def fullname(self):

            return '{} {}'.format(self.first, self.last)

        def apply_raise(self):

            self.pay = int(self.pay * self.raise_amt)

class Developers(Employee):

    pass

dev_1 = Employee ('Nwankwo','Fortune',70000)

dev_2 = Employee ('Test','User', 50000)

#print(dev_1.email)

#print(dev_2.email)

dev_1.apply_raise()

print(dev_1.pay)
Dec 23, 2019 in Python by anonymous
• 120 points
124 views
Hey!

Can you please post the entire error log?

Thanks

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

what is attribute error in python?

import pandas df = pd.read_csv('filename') it will give attribute ...READ MORE

answered Mar 27, 2019 in Python by Mohammad
• 3,210 points
364 views
0 votes
1 answer

Python error "'str' object has no attribute 'turtle' in Python turtle"

There is a syntax error. Change the ...READ MORE

answered Jul 8, 2019 in Python by Pallavi
1,734 views
+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

answered Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
171 views
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

answered Feb 14, 2019 in Python by Shashank
• 1,370 points
137 views
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 57,510 points
393 views
0 votes
1 answer

Key error in Python

A KeyError occurs when the Key doesn't ...READ MORE

answered Sep 20, 2018 in Python by SDeb
• 13,230 points
628 views
0 votes
1 answer

How can I print an Error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Oct 12, 2018 in Python by Aryya
• 7,350 points
77 views
0 votes
1 answer

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,520 points
33,830 views
0 votes
1 answer

Getting AttributeError: 'module' object (scipy) has no attribute 'misc' in Python. How to solve this?

>>> import scipy >>> scipy.misc Traceback (most recent call ...READ MORE

answered Dec 24, 2018 in Python by Nymeria
• 3,520 points
1,664 views