w3resource logo


Python Exercises

Python Exercise: Print a tuple with string formatting

Python tuple: Exercise-20 with Solution

Write a Python program to print a tuple with string formatting.

Sample tuple : (100, 200, 300)
Output : This is a tuple (100, 200, 300)

Sample Solution :-

Python Code :

t = (100, 200, 300)
print('This is a tuple {0}'.format(t))

Output:

This is a tuple (100, 200, 300)

Python Code Editor:

t = (100, 200, 300)
print('This is a tuple {0}'.format(t))

Improve this sample solution and post your code through Disqus.



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

Help the community:

Python: Fizzbuzz

C++: Decimal to binary conversion

JavaScript: Need Help in JavaScript

Python: Help me with this program