class Dog:
species = "Canis familiaris" # Class attribute
def __init__(self, name, breed):
self.name = name # Instance attribute
self.breed = breed # Instance attribute
def bark(self):
print(f"{self.name} says Woof!")
# Creating instances
dog1 = Dog("Buddy", "Golden Retriever")
dog2 = Dog("Lucy", "Labrador")
# Accessing attributes
print(f"{dog1.name} is a {dog1.breed}.")
print(f"All dogs are of species: {Dog.species}")
# Calling methods
dog1.bark()
dog2.bark()