Class and object property changes using dict property

technical talkiess
0

 Class and object property changes using dict property 

Object aur class ke sare element ko show karne ke liye iska use hota hai python me 


class Employee:

    no_of_leave = 8

    pass


vishal = Employee()

lakhan = Employee()




vishal.name = "vishal"

vishal.age = "27"

vishal.phone = "12345678"


lakhan.name = "Lakhan"

lakhan.age = "19"

lakhan.phone = "9860210840"


print(lakhan.__dict__)

lakhan.no_of_leave = 9

print(lakhan.__dict__)



print(lakhan.no_of_leave)

print(vishal.no_of_leave)

Post a Comment

0Comments

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

Post a Comment (0)