Semi-Weekly Self Reflection: March 2

Throughout this past week, I feel I have been great, but I have been off task a little bit to talk and interact with peers in the class.  Although I did get off task a bit, I still did manage to achieve my goal of 85%:

Not only that but throughout my learning I learned about binary and how to use it. The main thing I didn’t learn from the codecademy examples was the different number placements (like 10 is 2, and 01 is 1 and 11 is 3) so I had to ask Mr. Miller, or Loremaster Rellim (wait… what’s Rellim backwards????).

After I got through binary and the basics of it like slides and different commands like ^ and | and &, codecademy had me start working along classes. So far it’s quite easy to learn, but I’m not sure why they define (def ____() ) more than one thing? Why wouldn’t they just have the __init__() only?

class Animal(object):
    """Makes cute animals."""
    is_alive = True
    health = "good"
    def __init__(self, name, age):
        self.name = name
        self.age = age
    # Add your method here!
    def description(self):
        print self.name
        print self.age
        
sloth = Animal("John", 10)
ocelot = Animal("Frank", 23)

For example in this code, why do they have “def description(self):” as well as def __init__(self, name, age). Why don’t they just have one or the other.

My next goal is to get from 85% to about 92% because now that I’m getting higher up in percentages, the questions are getting harder to answer. Alone getting to 80% was tough, so I’m lowering my standard a little bit by giving myself a little more manageable goals

One thought on “Semi-Weekly Self Reflection: March 2”

  1. A. Setting reasonable goals based on experience is a _good_ thing. Nice job anticipating and setting yourself up for success.

    B. My guess would be that in an object environment, it’s occasionally useful to be able to ask an object what it is, even after it’s initialized. The description() method can thus be used to get quick info from an object at any time, rather that being packaged into the __init__() method and only accessible upon initial creation.

Leave a Reply

Your email address will not be published. Required fields are marked *