Beginner needs advice

Terry Reedy tjreedy at udel.edu
Sat May 28 18:18:56 EDT 2011


On 5/28/2011 2:57 PM, Uncle Ben wrote:

> Just this past Tuesday, I blindly downloaded 3.1 and found that at the
> level I am workloing, all it took to get my 2.7 code to run was to put
> parens around the print arguments and double the slashes in integer
> division. I didn't even use the 2to3 automation.

1//2 works in 2.7 and earlier.
from __future__ import division
gives 1/2 == 0.5 and in 3.x

print('abc') is the same as print 'abc'
The parens only make a difference with 2 or more items.

-- 
Terry Jan Reedy




More information about the Python-list mailing list