Introduction to Tuple :-
Python में Tuple एक built-in Sequence Data Type है, जिसका उपयोग multiple elements या values को एक ही variable में store करने के लिए किया जाता है। Tuple में elements को comma (,) से separate किया जाता है और सामान्यतः Tuple को parentheses ( ) के अंदर लिखा जाता है।
Tuple एक Ordered और Immutable Data Type है। इसका अर्थ है कि Tuple में elements का order निश्चित रहता है और Tuple create होने के बाद उसके existing elements को directly change, add या remove नहीं किया जा सकता।
English
A Tuple is a built-in Sequence Data Type in Python that is used to store multiple elements or values in a single variable. The elements of a tuple are separated by commas (,), and a tuple is generally written using parentheses ( ).
A Tuple is an Ordered and Immutable Data Type. This means that the order of elements remains fixed, and existing elements of a tuple cannot be directly changed, added, or removed after the tuple is created.
Example:-
student = ("Rahul", 20, "O Level")
print(student)
Output:-
('Rahul', 20, 'O Level')
Because:-
यहाँ student एक Tuple है जिसमें तीन elements हैं:
"Rahul" → पहला element
20 → दूसरा element
"O Level" → तीसरा element
इन सभी elements को एक ही variable student में store किया गया है।
English
Here, student is a tuple containing three elements. All three elements are stored in a single variable named student.