Answers for "python initialize a class"

0

python initialize a class

class EMPLOYEE:
    raise_amt = 1.04
		# constructor
    def __init__(self, first, last, pay):
        self.first = first
        self.last = last
        self.email = first + '.' + last + '@email.com'
        self.pay = pay

		# methods 
    def fullname(self):
        return '{} {}'.format(self.first, self.last)

    def apply_raise(self):
        self.pay = int(self.pay * self.raise_amt)

		def greeting(self):
				return f'My name is {self.first} and my email is {self.email}'
Posted by: Guest on June-21-2021

Code answers related to "python initialize a class"

Python Answers by Framework

Browse Popular Code Answers by Language