Class creation Basic

amannarayanm · October 12, 2021 · Python
class student:
    College = "Saket College Arts science and Commerce"
    def __init__(self,name,Class):
        self.name = name
        self.Class = Class
    def getyourDetails(self):
        print(f"\nName: {self.name}\nClass: {self.Class}\nCollege: {self.College}")
        
        
s1 = student("Aman Mishra","3rd Semester BSC-IT")
s1.getyourDetails()

Comments

Please sign up or log in to contribute to the discussion.