Multiply All Numbers in the List in Python Last Updated : 28 Oct, 2025 Comments Improve Suggest changes 68 Likes Like Report Given a list of numbers, the task is to find the product of all elements in the list. Multiplying all numbers in a list means multiplying each element together to get a single result.For example:For, arr = [2, 3, 4], result is 2 × 3 × 4 = 24. arr = [1, 5, 7, 2], result is 1 × 5 × 7 × 2 = 70.Let’s explore different methods to multiply all numbers in the list one by one.Using math.prod()The math library in Python provides the prod() function to calculate the product of each element in an iterable.Note: prod() method was added to the math library in Python 3.8. So, it is only available with Python 3.8 or greater versions. Python import math a = [2, 4, 8, 3] res = math.prod(a) print(res) Output192 Explanation:a = [2, 4, 8, 3]: A list of integers.math.prod(a): Multiplies all elements in the list (2 * 4 * 8 * 3).print(res): Outputs the result of the multiplication (192).Using reduce() and mul()We can use reduce() function from the functools module, which can apply a function to an iterable in a cumulative way. We can use the operator.mul() function to multiply the elements together. Python from functools import reduce from operator import mul a = [2, 4, 8, 3] res = reduce(mul, a) print(res) Output192 Explanation:a = [2, 4, 8, 3]: A list of integers.reduce(mul, a): Applies the mul operator (multiplication) cumulatively to the elements of a (i.e., 2 * 4 * 8 * 3).print(res): Outputs the result of the multiplication (192).Using a loopWe can simply use a loop (for loop) to iterate over the list elements and multiply them one by one. Python a = [2, 4, 8, 3] res = 1 for val in a: res = res * val print(res) Output192 Explanation: start with res = 1 and then multiply each number in the list with res using a for loop.Related Article:Multiple List Elements Using numpy.prod()Find Sum of all Elements in a ListFind Average of All Elements in a ListLoops – For, While and Nested Loopsmath.prod() methodreduce() Create Quiz Python program to multiply all numbers in the list Comment S Striver Follow 68 Improve S Striver Follow 68 Improve Article Tags : Misc Python Python-numpy python-list Python list-programs +1 More Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like