Monday, October 21, 2019

Python Class with Attribute Example


#################################################
# Python Class with Attribute Example
#################################################

class class_with_Attribute:
#class attribute Declaration
        type="Normal"

t1 = class_with_Attribute()
t2 = class_with_Attribute()

#Getting Output of Class Attribute
print (t1.type,t2.type)
#Output would be
# Normal Normal

#updating class Attribute value
testing.type="Advance"

print (t1.type,t2.type)
#Output would be
# Advance Advance

1 comment:

  1. I'm constantly searching on the internet for posts that will help me. I love if you publish the blogs often.
    visit site

    ReplyDelete

Wireless Security Configuration: Protect Your Network Now!

Introduction: In today’s connected world, wireless networks are as common as smartphones, and they’re often the gateway to our personal, pr...