Write a python program to find the product of largest and the smallest elements of a tuple  mytuple containing all numeric values. 


Answer:

# Find the largest and the smallest elements of the tuple using the max() and min() functions

largest = max(mytuple)

smallest = min(mytuple)

# Calculate the product of the largest and the smallest elements using the * operator

product = largest * smallest

# Print the product using the print() function

print("The product of the largest and the smallest elements of the tuple is", product)

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo