string formatter for tuple

skip at pobox.com skip at pobox.com
Thu Nov 2 10:43:41 EST 2006


>>>>> "Tim" == Tim Chase <python.list at tim.thechases.com> writes:

    >> How can I print a tuple with a single string format?

    Tim>        print "a = %s" % str(a)
    Tim> or
    Tim>        print "a = %s" % repr(a)

Or wrap the tuple in a tuple:

    print "a = %s" % (a,)

Skip



More information about the Python-list mailing list