Python

Set Comprehension in Python

In a previous article I discussed list comprehensions. Today I will talk about set comprehensions. Set comprehensions were added to Python in version 2.7 and they are similir to List Comprehensions, the only difference is that we use curly braces instead of square brackets when making them. A set is an un-ordered collection in which …

Set Comprehension in Python Read More »

The python lambda

Recently I learned how to use the lambda function, a simple, unbound one liner function. A lambda is similar to a normal Python function, the only difference is in the way it is used. The example below will explain better: The poww function defined above takes an argument x and squares it. So if we …

The python lambda Read More »