Some Basic Python Tuple Programs-3

Some Basic Python Tuple Programs-3

Python program to find the minimum and maximum value in a list of tuples tuple_list = [(6, 5), (3, 8), (1, 6), (4, 7), (3, 1)] ele1 = tuple(map(max, zip(*tuple_list))) ele2 = tuple(map(min, zip(*tuple_list))) print(ele1, el2) #Output: (6, 8) (1, 1) The built-in max() function returns the largest element in an iterable. The built-in min() … Read more

Some Basic Python Tuple Programs-1

Some basic tuple programs

Tuple A tuple is an immutable and sequential collection of data that can be indexed and sliced. Python tuple can contain homogeneous as well as heterogeneous values of data types such as integers, floats, strings, lists, and dictionaries. Python Program to concatenate multiple tuples tup1 = (7, 1, 9) tup2 = (5, 2, 3, 4, … Read more

%d bloggers like this: