Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk1 min

How to Print a Tuple in Python

Use print(tuple) to display a tuple in Python. Learn the trailing comma for one-item tuples and how to format tuple output in f-strings.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pass the tuple to Python’s built-in print() function:

t = (1, 'a')
print(t)

This displays (1, 'a'). For a one-item tuple, include a trailing comma when creating it: ('hello',).

Print a tuple directly

Give the tuple variable to print(); Python displays its tuple representation, including parentheses:

coordinates = (12, 8)
print(coordinates)

Output:

(12, 8)

Nested tuples retain their structure in the output, so their grouping remains visible. See the Python 3.14.7 tutorial on input and output and the Python tutorial’s tuple examples.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Print a one-item tuple

A trailing comma makes a one-item tuple; parentheses alone only group an expression. The comma is what makes the tuple, as the Python 3.14.8 built-in types reference explains.

one = ('hello',)
print(one)

Output:

('hello',)

Without the comma, ('hello') is just the string 'hello', not a tuple.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose how to format the output

For ordinary display, print(t) is sufficient. Use explicit conversions when the desired representation matters inside a larger message or in debugging output.

  • str(t) produces a representation intended to be fairly human-readable.
  • repr(t) requests a representation intended to be readable by the interpreter when possible, which is useful for debugging.

The Python 3.14.7 tutorial describes the distinction between str() and repr().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Embed a tuple in an f-string

Use an f-string to add explanatory text around the tuple:

t = (1, 'a')
print(f'Tuple: {t}')

By default, the value is formatted using its string conversion. Add !r to request repr(), or !s to request str() explicitly:

print(f'Debug value: {t!r}')
print(f'Display value: {t!s}')

For an ordinary built-in tuple, these forms usually show the same tuple-style output; the conversion flags make your formatting choice explicit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.