w3resource

Python Lambda - Exercises, Practice, Solution

Python Lambda [15 exercises with solution]

[An editor is available at the bottom of the page to write and execute the scripts.]

1. Write a Python program to create a lambda function that adds 15 to a given number passed in as an argument, also create a lambda function that multiplies argument x with argument y and print the result. Go to the editor
Click me to see the sample solution

2. Write a Python program to create a function that takes one argument, and that argument will be multiplied with an unknown given number. Go to the editor
Click me to see the sample solution

3. Write a Python program to sort a list of tuples using Lambda.
Click me to see the sample solution

4. Write a Python program to sort a list of dictionaries using Lambda. Go to the editor
Click me to see the sample solution

5. Write a Python program to filter a list of integers using Lambda. Go to the editor
Click me to see the sample solution

6. Write a Python program to square and cube every number in a given list of integers using Lambda. Go to the editor
Click me to see the sample solution

7. Write a Python program to find if a given string starts with a given character using Lambda. Go to the editor
Click me to see the sample solution

8. Write a Python program to extract year, month, date and time using Lambda. Go to the editor
Click me to see the sample solution

9. Write a Python program to check whether a given string is number or not using Lambda. Go to the editor
Click me to see the sample solution

10. Write a Python program to create Fibonacci series upto n using Lambda. Go to the editor
Click me to see the sample solution

11. Write a Python program to find intersection of two given arrays using Lambda. Go to the editor
Click me to see the sample solution

12. Write a Python program to rearrange positive and negative numbers in a given array using Lambda. Go to the editor
Click me to see the sample solution

13. Write a Python program to count the even, odd numbers in a given array of integers using Lambda. Go to the editor
Click me to see the sample solution

14. Write a Python program to filter a given list whether the values in the list are having length of 6 using Lambda. Go to the editor
Click me to see the sample solution

15. Write a Python program to add two given lists using map and lambda. Go to the editor
Click me to see the sample solution

Python Code Editor:

More to Come !

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.



Python: Tips of the Day

Python: Emoji codes

 


Inviting useful, relevant, well-written and unique guest posts