Teach the

lazy snake

some functions!

Indian Institute of Technology, Bombay

by

What do I have for you?

  • Introduction to functional programming
  • Daily usage (but do you know about them?)
  • What Python has to offer
  • Extending the standard offering, Python libraries

Paradigms of programming

  • Procedural
  • Object oriented
  • Functional
  • Logic
  • ...

...and Python is a mixed bag!

==

What is a functional program?

I use functions all day...

Think mathematically, y = f (x)

Functions in Python

Python has first-class functions

Functions can take in functions as arguments

Functions can return functions

Time to get some action!

*demo on first order function*

*introduction to lambdas, anon functions*

*built-ins, filter, map, etc.
though list comprehension (yay!)*

import functools

*examples on partial, Haskell reference*

*decorators*

Cons of using Python

  • Purely functional hard to achieve...
  • Have an intuition on where to use

Hope you enjoyed!

GitHub: Sumith1896

Twitter: @Sumith1896

Facebook: Sumith Kulal

Email: sumith1896@gmail.com

Get in touch :)

"Programs must be written for people to read, and only incidentally for machines to execute."

                                              - Harold Abelson

Catch me at

Made with Slides.com