instance and class in python

technical talkiess
0

 class student:

    no_of_record = 9

    pass


# instance of the class 

vishal = student()

lakhan = student()


vishal.name ='vishal'

vishal.age = 19

vishal.salary = 34444

print(vishal)


lakhan.name ='Lakhan'

lakhan.age = 19

lakhan.salary = 34444


print(lakhan.name)


# You not change the class properties using instance variable 

lakhan.no_of_record = 10

print(lakhan.no_of_record)


print(student.no_of_record)

Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)