Python Part - 3


Python Tuples:
Python Tuples are data structures like Python lists. They are just sequences written in round brackets and elements are seperated by commas.

tup = (90,'abc')

Accessing values :
Values in tuple are accessed in the same way as in lists.





Now, unlike Python lists in Python Tuples we can't change the element but we can delete it. eg : tup = ('as', 30) del tup;
Tuple Operations :



As shown in above image, various operations can be performed on tuples also. One disadvantage in Tuples is that elements cannot be changed.

No comments:

Post a Comment

SAY HELLO!!