Write a Python program to create a tuple with different data types


The program is written in Python and performs the following steps:

  • A tuple x is defined with five elements, "Tutor Joes", a boolean value True, a string "T", a floating-point number 3.21, and an integer 10.
  • The x tuple is printed to the console.

Tuples are ordered, immutable collections of elements in Python. The x tuple in the program contains five elements of different data types: a string, a boolean, a string, a float, and an integer. The entire tuple can be printed to the console using the print statement.

Source Code

x = ("Tutor Joes", True,'T', 3.21, 10)
print(x)

Output

('Tutor Joes', True, 'T', 3.21, 10)

Example Programs