A Hundred Days of Code, Day 018 - Python Comprehensions, Done!

Continuing my comprehensions journey. Hopefully it makes more sense this time around Notes ** Set Comprehensions ** If I want a set of uniques from a group, I could use a set. Or like Reuven likes to joke, a set is a dictionary with no values; an immoral dictionary 😂 Create it with a somesetcomp = set('somecondition' for a something in somethingbig) or in a simpler manner, somesetcomp = {'somecondition' for something in somethingbig} Protip, better to start with a list comprehension, be done with figuring out stuff and then just switch the brackets at the end....

July 26, 2020 · Mario Jason Braganza

A Hundred Days of Code, Day 006 - Starting and Quitting Comprehensions

I know I said, I’d start with the basics, Reuven, but please forgive me this once :) Will do the rest, bottom up :) Have started up with this, because I’m fascinated with how folks manage to build in so much functionality into short, easy to read statements. To my mind, comprehensions are the pithy proverbs of the programming world. So here goes … Notes This style of writing code, comes from functional programming Functional Programming is another style of writing code It assumes that data is immutable....

July 13, 2020 · Mario Jason Braganza