· 7 years ago · Nov 13, 2018, 05:26 AM
1class Employee:
2 def init(self, first, let, pay) :
3 self. first=first
4 self. last=last
5 self. email=first+'.'+last+'@gmail.com'
6
7emp=Employee('ved', 'root', 5000)
8
9print(emp.email)
10-typeerror:Employee() takes no arguments
11
12class Employee:
13 def __init__(self, first, last, pay):
14 self.first = first
15 self.last = last
16 self.email = first + '.' + last + '@gmail.com'
17
18emp = Employee('ved', 'root', 5000)
19print(emp.email)