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 »

Python List Comprehensions

A special syntax form in the Python language is the list comprehension. List comprehensions allow programmers to make their code more compact and (sometimes) harder to read if they push the comprehensions too far! The syntax consists of an expression in square brackets to create a new list. In order to show the beauty of …

Python List Comprehensions 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 »

Reflections: Why I won’t quit Python

At the beginning of the year I made a very important decision. I decided to learn Python, the programming language for those that don’t know. I have done well for myself and I’ve made certain progress in this respect.

The new Unit Conversion App

A few weeks ago I blogged about a unit conversion app that I was working on. I doubt that I’ll be working on that project anymore. I found on github a similar project that was written better than mine(its design is modular, the style is clean and just better than my own) but the said …

The new Unit Conversion App Read More »

Python 101: Getting it

This post is part 1 of Get started with Python programming series, in which I do my best to share my experiences in learning python and hope that this becomes some sort of guide to help you become a Python programmer. In today’s post, I explain how to get and setup Python. Getting Started with …

Python 101: Getting it Read More »

DOCTEST : An easy testing tool

According to author Daniel Arbuckle, Doctest is the easiest and fastest way to write tests for your python software.Doctest is a program that comes bundled with python that allows you to write down what you expect from your code in a way that’s easy to understand. Doctests are written in plain text usually in code …

DOCTEST : An easy testing tool Read More »