Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pop': 0.05; 'method.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rewrite': 0.09; 'subject:()': 0.09; 'subject:while': 0.09; 'python': 0.11; 'def': 0.12; 'wrote': 0.14; 'means.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:python': 0.16; 'trying': 0.19; 'question': 0.24; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'statement': 0.30; "i'm": 0.30; 'subject:About': 0.31; 'extend': 0.32; 'to:addr:python-list': 0.38; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; "you're": 0.61; 'first': 0.61; 'subject::': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re:About python while statement and pop() Date: Wed, 11 Jun 2014 22:34:43 -0500 (CDT) Organization: news.gmane.org References: <8d6207ab-b883-4940-8e53-75546a91d4dd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: pool-71-97-196-195.hstntx.dsl-w.verizon.net X-Newsreader: PiaoHong.NewsGroup.Client.VIP:1.53 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402544026 news.xs4all.nl 2929 [2001:888:2000:d::a6]:58534 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73197 hito koto Wrote in message: > 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? No idea what the question means. Are you just trying to rewrite the loop in a python implementation where pop is broken? > > i want to change this is code: > > def foo(x): > y = [] > while x !=[]: > y.append(x.pop()) > return y Perhaps you're looking for the extend method. -- DaveA