Max and Min, Conversion of Tuple into list, string or list into a tuple and it type, in Python

Tuple into the list, string, or list into a tuple and its type, in Python

What is min and max in Python?

 This article is very interesting and Lesser known functions of Python, i.e max ()
And min (). Now when they are compared to C ++. The opposition, which makes only two arguments,
That too strictly float, int or char, these Functions are not only limited to 2 elements but can hold many elements as arguments and can also support strings in their arguments, therefore lexicographically allowing even the smallest or largest string to be displayed.

Find Max() and Min() – Example

number = (12,5,15,5)

print(max(number)) # max 15

print(min(number)) # min 5

print(sum(number)) # sum 37

How to convert Tuple into List

# Conversion of Tuple into list,string or list
into tuple and it type

print(type(nums))              # <class,'tuple'
print(nums1)       # OutPut = [1,2,3,4,5,6,7,8,9]

How to convert Tuple into String

(type(nums1)) # OutPut = <class,’list>
nums2=str(nums) print(type(nums2)) # OutPut = <class,’str’>

Related Post:

learn more about salesforce

Pramod Kumar Yadav is from Janakpur Dham, Nepal. He was born on December 23, 1994, and has one elder brother and two elder sisters. He completed his education at various schools and colleges in Nepal and completed a degree in Computer Science Engineering from MITS in Andhra Pradesh, India. Pramod has worked as the owner of RC Educational Foundation Pvt Ltd, a teacher, and an Educational Consultant, and is currently working as an Engineer and Digital Marketer.

Leave a Comment