About python while statement and pop()
Vincent Vande Vyvre
vincent.vandevyvre at swing.be
Wed Jun 11 23:40:04 EDT 2014
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>
More information about the Python-list
mailing list