In Python, Lambda function is an anonymous function, which means that it is a function without a name. It can have any number of arguments… Read More

# Tag Archives: python-lambda

In Python, we use the lambda keyword to declare an anonymous function. Lambda function behaves in the same way as regular functions behave that are… Read More

List comprehension: List comprehension is an elegant way to define and create a list in python. We can create lists just like mathematical statements and… Read More

Prerequisites: Python lambda In Python, anonymous function means that a function is without a name. As we already know the def keyword is used to… Read More

In Python, anonymous function means that a function is without a name. As we already know that def keyword is used to define the normal… Read More

Given two strings (of lowercase letters), a pattern and a string. The task is to sort string according to the order defined by pattern and… Read More

The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..… Read More

What are lambda expressions? A lambda expression is a special syntax to create functions without names. These functions are called lambda functions. These lambda functions… Read More

Given a list of numbers, write a Python program to count Even and Odd numbers in a List. Example: Input: list1 = [2, 7, 5,… Read More

Given two arrays, find their intersection. Examples: Input: arr1[] = [1, 3, 4, 5, 7] arr2[] = [2, 3, 5, 6] Output: Intersection : [3,… Read More

Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number… Read More

Given a string S, c1 and c2. Replace character c1 with c2 and c2 with c1. Examples: Input : str = 'grrksfoegrrks' c1 = e,… Read More

Prerequisite : Lambda in Python Given a list of numbers, find all numbers divisible by 13. Input : my_list = [12, 65, 54, 39, 102,… Read More

Given an array of positive and negative numbers, arrange them such that all negative integers appear before all the positive integers in the array. The… Read More

In Python, an anonymous function means that a function is without a name. As we already know that the def keyword is used to define… Read More