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


Groups > comp.lang.python > #73198

Re: About python while statement and pop()

Date 2014-06-12 05:40 +0200
From Vincent Vande Vyvre <vincent.vandevyvre@swing.be>
Subject Re: About python while statement and pop()
References <8d6207ab-b883-4940-8e53-75546a91d4dd@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.11025.1402544865.18130.python-list@python.org> (permalink)

Show all headers | View raw


Le 12/06/2014 05:12, hito koto a écrit :
> Hello,all
> I'm first time,
>
> I want to make a while statement which can function the same x.pop () and without the use of pop、how can i to do?
>
> i want to change this is code:
>
> def foo(x):
>      y = []
>      while x !=[]:
>          y.append(x.pop())
>      return y
Something like that :

def foo(x):
     return reversed(x)

-- 
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte 
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>

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


Thread

About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 20:12 -0700
  Re:About python while statement and pop() Dave Angel <davea@davea.name> - 2014-06-11 22:34 -0500
  Re: About python while statement and pop() Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2014-06-12 05:40 +0200
  Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-12 13:58 +1000
    Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 21:56 -0700
      Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-12 15:08 +1000
      Re: About python while statement and pop() Steven D'Aprano <steve@pearwood.info> - 2014-06-12 05:43 +0000
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-11 23:06 -0700
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-12 00:13 -0700
        Re: About python while statement and pop() hito koto <hitokoto2014@gmail.com> - 2014-06-12 02:51 -0700
  Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 11:41 -0500
  Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 11:49 -0500
    Re: About python while statement and pop() Marko Rauhamaa <marko@pacujo.net> - 2014-06-12 19:55 +0300
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:07 -0500
    Re: About python while statement and pop() Chris Angelico <rosuav@gmail.com> - 2014-06-13 02:57 +1000
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:10 -0500
      Re: About python while statement and pop() Mark H Harris <harrismh777@gmail.com> - 2014-06-12 12:16 -0500
        Re: About python while statement and pop() wxjmfauth@gmail.com - 2014-06-12 11:37 -0700

csiph-web