Quick actions

cmd+k|ctrl+k

Navigation

Languages

fromScratch01march2025

Snippet info

Language

Python

Visibility

public

Author

ricardodocencia1998

Created

2025-03-22T19:20:10.320075Z

Updated

2025-03-22T19:20:10.320075Z

class Dog:
    species = "Canine"  # Class attribute

    def __init__(self, name, age):
        self.name = name  # Instance attribute
        self.age = age  # Instance attribute

# Creating an object of the Dog class
dog1 = Dog("Buddy", 3)

print(dog1.name) 
print(dog1.species)
INFO