Category Archives

First Class functions in Python

First class objects in a language are handled uniformly throughout. They may be stored in data structures, passed as...

First Class functions in Python

First class objects in a language are handled uniformly throughout. They may be stored in data structures, passed as...

Partial Functions in Python

Partial functions allow us to fix a certain number of arguments of a function and generate a new function....

Partial Functions in Python

Partial functions allow us to fix a certain number of arguments of a function and generate a new function....

Returning Multiple Values in Python

In Python, we can return multiple values from a function. Following are different ways 1) Using Object: This is...

Returning Multiple Values in Python

In Python, we can return multiple values from a function. Following are different ways 1) Using Object: This is...

When to use yield instead of return in Python?

The yield statement suspends function’s execution and sends a value back to the caller, but retains enough state to...

When to use yield instead of return in Python?

The yield statement suspends function’s execution and sends a value back to the caller, but retains enough state to...

class method vs static method in Python

Class Method The @classmethod decorator, is a builtin function decorator that is an expression that gets evaluated after your...

class method vs static method in Python

Class Method The @classmethod decorator, is a builtin function decorator that is an expression that gets evaluated after your...

Functions in Python

A function in Python is an aggregation of related statements designed to perform a computational, logical, or evaluative task....

Functions in Python

A function in Python is an aggregation of related statements designed to perform a computational, logical, or evaluative task....

Generator Expressions

In Python, to create iterators, we can use both regular functions and generators. Generators are written just like a...

Generator Expressions

In Python, to create iterators, we can use both regular functions and generators. Generators are written just like a...

Generators in Python

There are two terms involved when we discuss generators. Generator-Function : A generator-function is defined like a normal function,...

Generators in Python

There are two terms involved when we discuss generators. Generator-Function : A generator-function is defined like a normal function,...

Python | Difference between iterable and iterator

Iterable is an object, which one can iterate over. It generates an Iterator when passed to iter() method. Iterator...

Python | Difference between iterable and iterator

Iterable is an object, which one can iterate over. It generates an Iterator when passed to iter() method. Iterator...