1- ## Built in Function For tuple : loudspeaker :
2- There are number of built in functions are available to process tuple
1+ ## Built- in Function For tuple
2+ There are the number of built- in functions are available to process tuple
33
44### 1.length :straight_ruler :
55- ** len()** function is used to return number of elements inside in tuple.
@@ -11,43 +11,64 @@ len(tuplename)
1111Example:
1212``` python
1313mytuple= (1 ,2 ,3 ,5 ,4 ,8 ,4 )
14+
15+ # length of tuple
1416res= len (mytuple)
15- print (res)
16- # Result:7
17+
18+ print (" Length Of Tuple" )
19+ print (res)
20+ ```
21+ Output:
22+ ```
23+ 7
1724```
1825
19- ### 2.max() : truck :
26+ ### 2.max()
2027- The ** max()** method returns the largest element in an iterable or largest of two or more parameters.
2128Syntax:
2229``` python
2330max (iterable, * iterables[,key, default])
2431max (arg1, arg2, * args[, key])
25- ```
32+ ```
2633
2734Example:
2835``` python
2936mytuple= (1 ,2 ,3 ,5 ,4 ,8 ,4 )
37+ # Get Maximum High Element
3038res= max (mytuple)
39+ print (" Max Element" )
3140print (res)
32- # Result:8
3341```
42+ Output:
43+ ```
44+ Max Element
45+ 8
46+ ```
47+
3448### 3.min() :bike :
3549- The ** min()** method returns the smallest element in an iterable or largest of two or more parameters.
3650Syntax:
3751``` python
3852min (iterable, * iterables[,key, default])
3953min (arg1, arg2, * args[, key])
40- ```
54+ ```
4155
4256Example:
4357``` python
4458mytuple= (1 ,2 ,3 ,5 ,4 ,8 ,4 )
59+
60+ # Get Minimum Amount
4561res= min (mytuple)
62+ print (" Min Element" )
63+
4664print (res)
47- # Result:1
65+ ```
66+ Output:
67+ ```
68+ 1
4869```
4970
50- ### 4.any() : performing_arts :
71+ ### 4.any()
5172- Return True if any element of the iterable is true
5273- If the iterable is empty, return False.
5374
@@ -78,8 +99,16 @@ tupl5 = ()
7899print (any (tupl5))
79100# Result:False
80101```
102+ Output:
103+ ```
104+ True
105+ False
106+ True
107+ True
108+ False
109+ ```
81110
82- ### 5.all() : dolls :
111+ ### 5.all()
83112- Return True if all elements of the iterable are true (or if the iterable is empty)
84113
85114
@@ -110,3 +139,11 @@ tupl5 = ()
110139print(any(tupl5))
111140#Result:True
112141```
142+ Output:
143+ ```
144+ True
145+ False
146+ True
147+ True
148+ False
149+ ```
0 commit comments