[Biopython] Print statements vs functions (Python 2 vs 3)

Peter Cock p.j.a.cock at googlemail.com
Mon Sep 9 14:49:16 UTC 2013


On Mon, Sep 9, 2013 at 3:35 PM, Carlos Borroto <carlos.borroto at gmail.com> wrote:
> On Sat, Sep 7, 2013 at 7:41 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> or more elegantly,
>>
>>>>> print("Two plus two is %i" % 4)
>
> Shouldn't this be done even more elegantly with something like this:
>
>>>> print( "Two plus two is {0:d}".format( 4 ) )
>
> --Carlos

Personally I find the % version shorter and clearer, but this
may reflect my past exposure to C.

Where you have more than a couple of place holders,
naming them seems a bigger win through.

Peter



More information about the Biopython mailing list