Python with Tuples

•

In this post we were discuss about what are tuples and how that tuples are implemented in python language

Concept of Tuples…

Tuples are group of data assign to a single variable. In other words tuples are like bunch of books in a box where box is a variable and books are different data like numbers, strings, boolean

First we declared a variable name ‘ data ‘ and then assign some values to that variable name ‘ data ‘

data = ["Amazon","Flipkart","Cars","Buses","Playstation"]

Now it’s time to print the values inside the variable name ‘ data ‘

Print Single Value From Tuple…

Note:- Always remember that in tuples , lists or dictionaries values assign to variable starts with 0

print(data[2]) 
print(data[0]) 
print(data[1]) 

Thanks for visiting the post..

Pls comments and share the post for support…

Leave a Reply

Your email address will not be published. Required fields are marked *