A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/086972.html below:

why does the % string format operator only take tuples?

why does the % string format operator only take tuples? why does the % string format operator only take tuples?Ram Bhamidipaty ramb at synopsys.com
Tue Apr 3 13:48:15 EDT 2001
Its possible to do this:
  print "%d %d" % (1,2)
but not this:
  print "%d %d" % [1,2]

Why?

I know I can convert the list to a tuple. I want to know
if there is a reason for % not taking lists as well as tuples.

Does anyone else think it would be a good idea of the % operator
were extended to also handle lists?

-Ram

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4