Python Tuple in Hindi | python tuple with examples in Hindi

Python tupletuple Ek Data Structure hai joki aap bol sakte hai ordered collection of items & tuple aapne inside me kuch bhi data store kar sakta hai for example :- float , string , integer | Lekin Tuple Ko Ek baar Create Karne Ke Bad Tuple Ko Update Nhi Kar Sakte Hai |

Python tuple in Hindi

Python Tuple ka Kiya Fayda Hai ? – Tuple Ko Ham Jab Istemal Karte Hai Jab Hame Pta Hota Hai Ki Hamara Data Change Nhi Hone Wala Tab ham Python Tuple Istemal Karte Hai |

Tuple in python ko Or Accha Samanjh ne ke liye iske A To Z example dekhte |

Python Tuple Or List Me Kiya Deference Hai ? – List or tuple me Keval kuch deference hai for example list mei aap kuch bhi data add & remove & delete kar sakte hai lekin aap tuple me Aesa Nhi kar Sakte hai Kyoki Tuple Ek Baar Create Hone Ke Bad Aap Usse Update Nhi Kar Sakte Hai |

Python Create Tuple

Syntax :

variable name = ( Parentheses )  

Aap upper diye gye syntax ko dekh sakte hai.

Python Tuple in Hindi | python tuple with examples in Hindi

python tuple functions

Example 1 :-

data  = ( 1 , "Danish Ali " , 8.0 )
print(data)

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

(1, 'Danish Ali ', 8.0) 

Aap upper Diye gye output ko dekh kar program ko samanjh sakte hai.

Example 2 :-

data  = ( 1 , "Danish Ali " , 8.0 )

for i in data:
    print(i)

Output :-

1                                                                                                                             
Danish Ali                                                                                                                    
8.0  

Aap Upper Diye gye output ko dekh kar program ko samanjh sakte hai.

python tuple slicing & Indexing

Example 3:-

data  = ( 1 , "Danish Ali " , 8.0 )   # 1 index par Danish Ali 
print(data[1])

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

Danish Ali

Aap upper Diye gye tuple Slicing ke output ko dekh kar program ko samanjh sakte hai.

Example 4:-

data  = ( 1 , "Danish Ali " , 8.0 )
print(data[0:2])

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

(1, 'Danish Ali ')

Aap upper Diye gye Python Slicing ke output ko dekh kar program ko samanjh sakte hai.

Creating Tuple Using Range () Function

Example 5:-

data  = tuple(range(0,10,1))
print(data)

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

Aap upper Diye gye Range Function ke tuple create ke output ko dekh kar program ko samanjh sakte hai |

python tuple Len()

Python Len() Function :- len Function Python Me Length Find Karne Ke lIye Use Hota Hai |

Example 6:-

data  = ( 1 , "Danish Ali " , 8.0 )
print(len(data))

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

3

Aap upper Diye gye output ko dekh kar program ko samanjh sakte hai |

Tuple With One Element

Python Type() :- Type Function python me keval type batane ke liye istemal hota hai |

Example 7:-

nums = (1)    # this is not tuple
nums1 = (1,)   # this is tuple

print(type(nums))
print(type(nums1))


name = ('Danish')   # this is not tuple
name1 = ('Danish',) # this is tuple

print(type(name))
print(type(name1))

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

<class 'int'>                                                                                                                 
<class 'tuple'> 

<class 'str'>                                                                                                                 
<class 'tuple'> 

Aap upper Diye gye tuple with one elements & type function ke output ko dekh kar program ko samanjh sakte hai |

python list inside tuple

Python tuple Function :- Jese ki Aapko Pta hai ki ham tuple ke inside se kuch bhi data add Ya Delete Nhi Kar sakte Hai Lekin Ham tuple inside list ke sath bhi kuch kar sakte hai |

Example 8:-

data = ( 1 , "Danish Ali " , 8.0 , ["Danish" , "Ali" , 29],"Dk")
print(data)

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

(1, 'Danish Ali ', 8.0, ['Danish', 'Ali', 29], 'Dk') 

Aap upper Diye gye ke output ko dekh kar program ko samanjh sakte hai |

Example 9:-

# list index position 3 

data = ( 1 , "Danish Ali " , 8.0 , ["Danish" , "Ali" , 29],"Dk")

data[3].pop()
data[3].append("Master")
data[3].remove("Danish")

print(data)
    

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

(1, 'Danish Ali ', 8.0, ['Ali', 'Master'], 'Dk')

Aap upper Diye gye output ko dekh kar program ko samanjh sakte hai |

python min & max Function

Python min & max Function :- min & max Function se ham tuple me uski minimum value ya maximum value find kar sakte hai |

Example 10:-

# using max(arg1, arg2, *args)

print('Maximum is:', max(1, 3, 2, 5, 4))

# using max(arg1, arg2, *args)
print('Maximum is:', min(1, 3, 2, 5, 4))

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

Maximum is: 5                                                                                                                 
Maximum is: 1 

Aap upper Diye gye min & max in Python Function ke output ko dekh kar program ko samanjh sakte hai |

Concatenation of two tuple

Example 11:-

data1 = ("Danish" , "Ali" , 29)
data2 = ("Master" , "Programing", ".com")

print(data1 + data2)    # concatenation data1 and data2

Aap Upper Diye Gye Program ko samanjh sakte hai.

Output :-

('Danish', 'Ali', 29, 'Master', 'Programing', '.com')

Aap upper Diye gye Concatenation of two tuples ke output ko dekh kar program ko samanjh sakte hai |

Dosto mujhe ummed hai ki aap python tuple with examples in Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Please follow and like us:
error
Summary
Review Date
Reviewed Item
Python Tuple in Hindi | python tuple with examples in Hindi
Author Rating
51star1star1star1star1star

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

One thought on “Python Tuple in Hindi | python tuple with examples in Hindi

Leave a Reply

Your e-mail address will not be published. Required fields are marked *