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


Groups > comp.lang.python > #63173 > unrolled thread

Re: print range in python3.3

Started byChris Angelico <rosuav@gmail.com>
First post2014-01-05 18:56 +1100
Last post2014-01-05 18:56 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: print range in python3.3 Chris Angelico <rosuav@gmail.com> - 2014-01-05 18:56 +1100

#63173 — Re: print range in python3.3

FromChris Angelico <rosuav@gmail.com>
Date2014-01-05 18:56 +1100
SubjectRe: print range in python3.3
Message-ID<mailman.4932.1388908606.18130.python-list@python.org>
On Sun, Jan 5, 2014 at 6:38 PM, luofeiyu <elearn2014@gmail.com> wrote:
>>>> range(1,10)
> range(1, 10)
>>>> print(range(1,10))
> range(1, 10)
>
> how can i get 1,2,3,4,5,6,7,8,9 in python3.3 ?

Are you looking for a list? That's what Python 2 returned. In Python
3, you can get that like this:

>>> list(range(1,10))
[1, 2, 3, 4, 5, 6, 7, 8, 9]

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web