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


Groups > comp.lang.python > #63173

Re: print range in python3.3

References <52C90BE5.3010909@gmail.com>
Date 2014-01-05 18:56 +1100
Subject Re: print range in python3.3
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4932.1388908606.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

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

csiph-web