Saturday, 1 February 2014

Slog #2 (Week 4) - Recursion and Lists Comprehensions

Today I learned recursion and lists comprehensions. Okay, enough with the boring formal talk. Heh. Lists comprehensions are pretty sick. I've never actually dealt with it before, so seeing it in action today was pretty cool. Being able to create a list automatically in one line is pretty damn neat.

This week we focused on the theme of recursion, and with a sprinkle of lists comprehension. We worked through some problems such as nested lists, and it really required a certain mindset that I haven't adjusted to yet. Also, doing these problems I learnt about using if and else statements in one line. I thought it was pretty cool to be able to do such a thing. Execute this if this this lines happens to be true, and otherwise this if the line is false. This could make for some pretty short and efficient code, which I am a fan of. Long gone are the days of if and else blocks!

No comments:

Post a Comment