Python Programming
About Lesson

Tuple is also one of the python’s internal data structures. The differences between lists and tuple are:
1. Lists are created using square brackets while tuples are created with parenthesis.
2. Lists are mutable while Tuples are immutable

#Exampe
tup1 = (‘physics’, ‘chemistry’, 1997, 2000);
tup2 = (1, 2, 3, 4, 5 );
tup3 = “a”, “b”, “c”, “d”
tup1 = (); #Empty tuple
tup1 = (50,); #list with single element must be created with additional comma

#NOT a tuple
thistuple = (“apple”)
print(type(thistuple))

You cannot copy content of this page