Write a Python program to find the maximum and minimum product from the pairs of tuple within a given list
- برمجة
- برمجة بايثون
- 2021-04-16
- salsabeelalhams99111801528
الأجوبة
def tuple_max_val(nums):
result_max = max([abs(x * y) for x, y in nums] )
result_min = min([abs(x * y) for x, y in nums] )
return result_max,result_min
nums = [(2, 7), (2, 6), (1, 8), (4, 9)]
print("The original list, tuple : ")
print(nums)
print("\nMaximum and minimum product from the pairs of the said tuple of list:")
print(tuple_max_val(nums))
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال