Create and Print a Tuple :
thistuple = ("apple", "banana", "cherry")
print(thistuple)
Output :
('apple', 'banana', 'cherry')
Tuple With Duplicates :
thistuple = ("apple", "banana", "cherry", "apple", "cherry")
print(thistuple)
Output :
('apple', 'banana', 'cherry', 'apple', 'cherry')
Tuple Length :
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))
Output :
3
Create Tuple With One Item :
thistuple = ("apple",)
print(type(thistuple))
Output :
<class 'tuple'>
Not a Tuple (Single Element Without Comma) :
thistuple = ("apple")
print(type(thistuple))
Output :
<class 'str'>