Skip to content

Instantly share code, notes, and snippets.

View briandk's full-sized avatar

Brian A. Danielak briandk

View GitHub Profile
@briandk
briandk / babys-first-functions.py
Created November 2, 2016 21:42 — forked from anonymous/babys-first-functions.py
Maybe we don't need object-oriented programming (OOP) in a first-semester computational modeling course
# Here's a dictionary literal with data and behavior in one line of code
baby1 = {
"first_function": lambda x: x + 1,
"first_words": "Zoiby want to buy on margin"
}
# Here's a much more complicated OOP solution in 5 lines
class Baby:
def __init__(self, first_function, first_words):
"""