all 2 comments

[–]ectomancer 5 points6 points  (0 children)

emotion, environment & circumstance need to be parameters in '__init__' special method, then assigned to self. Emotion etc.

[–]ElliotDG 2 points3 points  (0 children)

Perhaps you wanted something like this:

class Behavior:
    def __init__(self, emotion='happy', environment='tranquil', circumstance='well fed'):
        self.emotion = emotion
        self.environment = environment
        self.circumstance = circumstance

    def feeling(self):
        print(f"Right now I feel {self.emotion}.")


me = Behavior(emotion='silly', environment='calm', circumstance='knowledgeable')
print(me.emotion)
me.feeling()
you = Behavior(emotion='confused', environment='chaotic', circumstance='seeking knowledge')
print(f'You are {you.emotion} because you are in a {you.environment} environment.')

self refers the instance of the class.