Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6494

Re: Beginner needs advice

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Beginner needs advice
Date 2011-05-28 18:18 -0400
References (2 earlier) <BANLkTim_-VfsApm9Uc60gv8WAzu9uGiV3g@mail.gmail.com> <4DDC7938.5000900@gmail.com> <BANLkTi=JCsVG1K++rz=VAgh_NSVXLe4Edw@mail.gmail.com> <mailman.2173.1306531260.9059.python-list@python.org> <11eb08a3-9cea-462f-ad1b-bf01d53f687a@z13g2000yqg.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.2205.1306621158.9059.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Beginner needs advice Ethan Furman <ethan@stoneleaf.us> - 2011-05-27 14:33 -0700
  Re: Beginner needs advice Uncle Ben <bgreen@nycap.rr.com> - 2011-05-28 11:57 -0700
    Re: Beginner needs advice Terry Reedy <tjreedy@udel.edu> - 2011-05-28 18:18 -0400

csiph-web