Python3 has two major differences: (1) print function requires parentheses (2) division returns floating point numbers
python3.4 -c 'print(40/48)' 0.8333333333333334 -erik On Wed, Sep 10, 2014 at 3:15 PM, Frank Loeffler <[email protected]> wrote: > > On Wed, Sep 10, 2014 at 07:11:50PM +0200, Roland Haas wrote: > > I think for parfiles, I'd be happy to be less C like and be more like eg > > perl (and python3) and do all arithmetic in floating point and either > > required and only cast to int at the point where the parameter is > > assigned. > > python -c 'print 40/48' gives me '0', but this is version <3. Is version > 3 really changing this? > > Frank > > > _______________________________________________ > Users mailing list > [email protected] > http://cactuscode.org/mailman/listinfo/users > -- Erik Schnetter <[email protected]> http://www.perimeterinstitute.ca/personal/eschnetter/
_______________________________________________ Users mailing list [email protected] http://cactuscode.org/mailman/listinfo/users
