Welcome to Brannon's Reading Notes!

This serves as my personal page to keep and update my reading notes for Code Fellows Courses 201, 301, and 401.

Reading

Classes and Objects

class Dog:
    color = "Yellow"

    def bark(self):
        print("Woof woof!")

pluto = Dog()

You can use dot notation to access variables in the newly created object.

print(pluto.color)

"Yellow"

Assigning variables can be accomplished with init

class NumberHolder:

   def __init__(self, number):
       self.number = number

   def returnNumber(self):
       return self.number

var = NumberHolder(7)
print(var.returnNumber()) #Prints '7'

source

Thinking Recursively

  1. Reduce problem into simpler instances
  2. The base case is the most reduced version of the problem
  3. Thread the ‘state’ through each iteration by passing it to each recursive call

source

Fixtures