Chapter 11.
Practice
"Practice doesnt make perfect. Practice makes myelin, and myelin makes perfect."Daniel Coyle Read
Other Resources Getting Help
Chapter 12.
Programming Paradigms
"There are only two kinds of languages: the ones people complain about and the ones nobody uses." Bjarne Stroustrupprogramming paradigm State stateGlobal state Procedural Programming procedural programming
>> 14xyzxyz
>> Type r or c. q to quit:side effects Functional Programming Functional programming
>> Created!OrangeOrange(10, "dark orange")Created!OrangeOrange[object_name].[variable_name]
>> <__main__.Orange object at 0x101a787b8>
>> Created![object_name].[variable_name] = [new_value]
>> 10
>> dark orange
>> Created!colorweight"dark orange"10"light orange"100Orange
>> 100
>> light orange
>> Created!OrangesOrange
>> Created!
>> Created!
>> Created!rotmold
>> 0
>> 98.0
>> 200RectanglelenwidthareaRectanglechange_size Vocabulary Programming paradigm
>> 800
State
Global state
Procedural programming
Functional programming
Side effect
Object-oriented
Classes
Methods
Instance
Instance variables
Magic method
Instantiating a class Challenges Apple
CircleareaCircleareapimath
TriangleareaTrianglearea
Hexagoncalculate_perimeterHexagoncalculate_perimeter
Chapter 13.
The Four Pillars of Object-Oriented Programming
"Good design adds value faster than it adds cost."Thomas C. Galefour pillars of object-oriented programming Encapsulation Encapsulation
>> [100, 2, 3, 4, 5]numsnumsnumsnums[0] = 100private variablesprivate methodsPublic variables
>> [100, 2, 3, 4, 5]
>> Hello, World!print
>> 200
>> 200.1