

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: What Is Functional Programming?
incomplete
2: Why Python?
incomplete
3: Immutability
incomplete
4: Declarative Programming
incomplete
5: It's Math
incomplete
6: Classes vs. Functions
incomplete
7: Debugging FP
incomplete
8: Functional vs. OOP
incomplete
9: Statements vs. Expressions
incomplete
10: Ternary Expressions
incomplete
11: Functions Practice
incomplete
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Functional programming is a style (or "paradigm" if you're pretentious) of programming where we compose functions instead of mutating state (updating the value of variables).
Example of imperative code:
car = create_car()
car.add_gas(10)
car.clean_windows()
Example of functional code:
return clean_windows(add_gas(create_car()))
The important distinction is that in the functional example, we never change the value of the car variable, we just compose functions that return new values, with the outermost function, clean_windows in this case, returning the final result.
In this course, we're working on Doc2Doc, a command line tool for converting documents from one format to another. If you're familiar with Pandoc, the idea is similar.
Complete the stylize_title function. It should take a single string as input, and return a single string as output. The returned string should have both the title centered and a border added.
center_title and add_border.