human
Give me a the Python code you requested given the following:
I am working on the file ".ipynb_checkpoints/python-tutorial-checkpoint.ipynb".
The first task is:
Classes
The syntax for defining classes in Python is straightforward:
Can you write Python code for it?
assistant
#Here is the Python code you requested.

class Greeter:

    # Constructor
    def __init__(self, name):
        self.name = name  # Create an instance variable

    # Instance method
    def greet(self, loud=False):
        if loud:
            print ('HELLO, %s!' % self.name.upper())
        else:
            print ('Hello, %s' % self.name)

g = Greeter('Fred')  # Construct an instance of the Greeter class
g.greet()            # Call an instance method; prints "Hello, Fred"
g.greet(loud=True)   # Call an instance method; prints "HELLO, FRED!"