# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: PythonData
#     language: python
#     name: pythondata
# ---

# Example of class and objects in Python.  
class Cat:
    def __init__(self, name):
        self.name = name


# Creating an object in the "Cat: class. 
first_cat = Cat('Felix')
print(first_cat.name)

# Creating another object in the "Cat" class as part of a skill drill.
second_cat = Cat('Garfield')
print(second_cat.name)


class Dog:
    def __init__(self, name, color, sound):
        self.name = name
        self.color = color
        self.sound = sound

    def bark(self):
        return self.sound + ' ' + self.sound


first_dog = Dog('Fido', 'brown', 'woof!')
print(    first_dog.name)
print(first_dog.color)
first_dog.bark()

# Create another oject of the "Dog" class as partof a skill drill.
second_dog = Dog('Lady', 'blonde', 'arf!')
print(    second_dog.name)
print(second_dog.color)
second_dog.bark()

StarcoderdataJupyterScriptsDedupFiltered