Python: Multiply all the numbers in a given list using lambda
43. Multiply Numbers in List Lambda
Write a Python program to multiply all the numbers in a given list using lambda.
Sample Solution:
Python Code :
Sample Output:
Original list: [4, 3, 2, 2, -1, 18] Mmultiply all the numbers of the said list: -864 Original list: [2, 4, 8, 8, 3, 2, 9] Mmultiply all the numbers of the said list: 27648
For more Practice: Solve these Related Problems:
- Write a Python program to multiply all positive numbers in a given list using lambda.
- Write a Python program to multiply numbers at even indices in a list using lambda.
- Write a Python program to multiply all numbers in a list and then add a specified constant to the result using lambda.
- Write a Python program to multiply all numbers in a list and then compute the modulus of the result with a given divisor using lambda.
Go to:
Previous: Write a Python program to calculate the product of a given list of numbers using lambda.
Next: Write a Python program to calculate the average value of the numbers in a given tuple of tuples using lambda.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.