w3resource logo


Python Exercises

Python Exercise: Create a tuple with different data types

Python tuple: Exercise-2 with Solution

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

Sample Solution :-

Python Code :

>>> #Create a tuple with different data types
>>> tuplex = ("tuple", False, 3.2, 1)
>>> print(tuplex)

Output:

>>>
('tuple', False, 3.2, 1)
>>>

Python Code Editor:

#Create a tuple with different data types
tuplex = ("tuple", False, 3.2, 1)
print(tuplex)

Improve this sample solution and post your code through Disqus.



Join our Question Answer community to learn and share your programming knowledge.

Solve these problems:

Python: How to check whether a file exists using Python?

C#: Loops in c#

PHP: For each

SQL: JOIN using more than 5 tables

JavaScript: Blank Slide in Javascript Slideshow