Creating Our First Class In Python

Code file as described in the video

class Student:
    pass

harry = Student()
larry = Student()

harry.name = "Harry"
harry.std = 12
harry.section = 1
larry.std = 9
larry.subjects = ["hindi", "physics"]
print(harry.section, larry.subjects)



  


Be the first person to comment!

Comments(0)