Python Practice › Tuple Programs › Program 41

Product of a tuple

EasyTuple Programs · 41 of 70

Write a Python program to multiply all the elements of a tuple.

Advertisement
Input
(5, 4, 3, 1)
Output
60

Approach

  1. math.prod().

Solution

Python
import mathprint(math.prod((5, 4, 3, 1)))
Output
60
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More tuple programs

← All 70 Tuple Programs