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 Solution:-

Python Code:

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

Sample 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