Stupid string formatting question

Sean 'Shaleh' Perry shalehperry at attbi.com
Thu May 16 22:03:47 EDT 2002


>> There must be something you are not telling us. It works fine for me,
> 
> OK, here's an example.
> 
>     >>> def x():
>     ...   return "a", "b"
>     ... 
>     >>> print "%s/%s/%s/%s" % ("hi", "there", x())
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in ?
>     TypeError: not enough arguments for format string
> 

you just returned ("hi, "there", ("a", "b")) which is len(3) not 4.





More information about the Python-list mailing list