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

Ethical Hacking Techniques: Cracking WPA/WPA2 Wi-Fi Using WPS and Capturing Handshakes

In the realm of cyber security, ethical hacking plays a crucial role in identifying and addressing vulnerabilities. One of the areas where e...