Python Program to Create Tuple of Different Types

Write a Python Program to Create Different Types of Tuples and print them. This Python example shows the creation of integer, string, boolean, float, mixed tuple, tuple inside a tuple (nested tuple), and list tuple. 

# Different Type Tuples
 
numericTuple = (10, 20, 30, 40, 50)
print("Numeric Tuple Items = ", numericTuple )
 
floatTuple = (10.25, 11.20, 19.37, 41.598)
print("Float Tuple Items = ", floatTuple )
 
stringTuple = ('orange', 'Mango', 'Grape', 'Apple')
print("String Tuple Items = ", stringTuple )
 
booleanTuple = (True, False, False, True, True)
print("Boolean Tuple Items = ", booleanTuple )
 
mixedTuple = ('orange', 25, 'Mango', 36.75, False, 10)
print("Mixed Tuple Items = ", mixedTuple )
 
nestedTuple = (10, 20, ('orange', 'Mango'), 30)
print("Nested Tuple Items = ", nestedTuple )
 
listTuple = (10, 20, ['Grape', 'Apple'], 70)
print("List Tuple Items = ", listTuple )
Python Program to Create Tuple of Different Types

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.