class Student:
def __init__(self,first,last,major):
self.first=first
self.last=last
self.major=major
self.email= first + '.'+ last + '@'+ 'university.edu'
stud= Student("Leo","Umesh","Computer")
print(stud.email)
The output of the above program is as follows:
When you create the first instance of the class i.e. the object, the init method is called and the parameter self is set to the object value.
Run this python code online here