[EMAIL PROTECTED] wrote:
> > "Tim" == Tim Chase <[EMAIL PROTECTED]> 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 =
In <[EMAIL PROTECTED]>, jeremito wrote:
> I have the following in my code
>
> a = (1,2,3)
> print "a = %s" %a
>
> But when I run this, I get:
>
> TypeError: not all arguments converted during string formatting
>
> Now I realize why this happens, a is actually 3 elements when the print
> statem
Tim Chase wrote:
> print "a = %s" % repr(a)
or
print "a = %r" % (a,)
--
http://mail.python.org/mailman/listinfo/python-list
> "Tim" == Tim Chase <[EMAIL PROTECTED]> 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
--
http://mail.python.org/
jeremito wrote:
> I have the following in my code
>
> a = (1,2,3)
> print "a = %s" %a
>
> But when I run this, I get:
>
> TypeError: not all arguments converted during string formatting
>
> Now I realize why this happens, a is actually 3 elements when the print
> statement is only expecting to
> a = (1,2,3)
> print "a = %s" %a
>
> But when I run this, I get:
>
> TypeError: not all arguments converted during string formatting
>
> Now I realize why this happens, a is actually 3 elements when the print
> statement is only expecting to print one value. I tried
>
> print "a = %s" %(a)
>
I have the following in my code
a = (1,2,3)
print "a = %s" %a
But when I run this, I get:
TypeError: not all arguments converted during string formatting
Now I realize why this happens, a is actually 3 elements when the print
statement is only expecting to print one value. I tried
print "a =