In this python tuple program, we will create a tuple with different datatypes.
Steps to solve the program
- You can simply create a tuple with different datatypes by adding elements with different datatypes in () to create a tuple.
- Print the output.
tup = (2.6,1,'Python',True,[5, 6, 7],(5, 1, 4),{'a':123,'b':456})
print("Tuple: ",tup)
Output :
Tuple: (2.6, 1, 'Python', True, [5, 6, 7], (5, 1, 4), {'a': 123, 'b': 456})
1 thought on “Program to create a tuple with different datatypes”