Category «Python»

List Comprehension

Python supports a concept called “list comprehensions”. It can be used to construct lists in a very natural, easy way, like a mathematician is used to do.┬áList comprehension is a complete substitute for the lambda function as well as the functions map(), filter() and reduce().Usually we write mathematical collection of prime numbers, even and odd …

How to start with Python

When it comes to learning an object-oriented programming language, you might consider starting with either Python or Java. While Python can be more user-friendly than Java, as it has a more intuitive coding style, both languages do have their unique advantages for developers and end users. However, if you are just beginning your path towards …

Mutable vs immutable

Mutable and immutable are English words meaning “can change” and “cannot change” respectively. The meaning of the words is the same in the IT context; i.e. a mutable string can be changed, and an immutable string cannot be changed Python code:

Map Reduce in python

Map and Reduce are two powerful methods of Python that is used to solve big logical problems, suppose you have to calculate how many routers are making error in network. So write a single function and map it with list of files. The Reducer will then count the total number of routers. Python Code..