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
595 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,230 points
687 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
5,112 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
1,378 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
309 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
• 58,120 points
757 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,290 points
881 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,440 points
384 views
+1 vote
10 answers

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

Just for the record: >>> int('55063.000000') Traceback (most recent ...READ MORE

answered Aug 17, 2020 in Python by pakainfo
• 200 points
290,001 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
6,108 views