- function arguments: keyword arguments are ones where you actually given them a name while calling the function; positioinal arguments are the “normal” way, ones only defined by what order they’re passed in???
- “A variable is a mapping between a name and an object at a certain location in the computer's memory. For example, if you set
x = 5
, then x
is the variable's name, and the value 5
is stored in memory. Python keeps track of the mapping between the name x
and the location of the value using namespaces. Namespaces can be thought of as dictionaries, with the names as the keys of the dictionary, and locations in memory as the values.”
- file functions and methods
- useful built in functions:
map
, filter
, sorted
— they all take a function plus an iterable as args, and they apply the function in some way to each member of the iterable. also zip
- use
assert
to raise errors if e.g. input is not in the right form — can specify an error message
- “In some installations of Jupyter, graphs do not show automatically. Use the
%matplotlib inline
command at the beginning of your notebook to get around this.”
- python ethos: “there should be only one obvious way to do it” and “don’t repeat yourself”
ch 5- classes
- instance methods vs static methods vs class methods
- meaning of property vs attribute wrt objects and classes? so attritubte refers to the actual like variables and stuff. a property behaves like an attribute from the outside, but it’s actually defined by a method instead of a simple varible. using the decorator to declare a method as a propety basically just makes it so that you can call it without adding parentheses.
- getters and setters
- constructor? initializer?
- activity 14
ch 6 stdlib
- standard library things to check out