🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #8514

Czy mozna prosciej?

#8514
From: MarcinB
Date: Mon, 09 May 2005 21:13
27 lines
1282 bytes
Witam, od dwoch godzin ucze sie pythona, napisalem
krotki program ktory szuka wzorca w lanuchcu i 
za kazdym razem wypisuje ten wzorzec. 
Czy mozna to uproscic?

from string import *

l0='marcin marcinalapies'
l=[
['marcin', ['X','czlowiek']],
['pies',   ['kot','zwierze']],
['ala',    ['Y','czlowiek',100]]
]

for s in l:
 x=0
 while 1:
    v=find(l0[x:len(l0)], s[0])
    if v!=-1:
     x=x+v+len(s[0])
     print s[0]
    else: 
     break

pozdr
-- 
MarcinB
Technical Details
Message-ID: <pan.2005.05.09.21.13.37.809238@post.spampl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.internetia.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.internetia.pl!not-for-mail
From: MarcinB <marcin.spamburzynski@post.spampl>
Newsgroups: pl.comp.lang.python
Subject: Czy mozna prosciej?
Date: Mon, 09 May 2005 23:13:37 +0200
Organization: Netia Telekom S.A.
Lines: 27
Message-ID: <pan.2005.05.09.21.13.37.809238@post.spampl>
NNTP-Posting-Host: gw-ww.telsten.com
Mime-Version: 1.0
X-Trace: nefryt.internetia.pl 1115673180 9357 83.238.68.12 (9 May 2005 21:13:00 GMT)
X-Complaints-To: abuse@inetia.pl
NNTP-Posting-Date: Mon, 9 May 2005 21:13:00 +0000 (UTC)
X-Tech-Contact: usenet@internetia.pl
User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table)
X-Server-Info: http://www.internetia.pl/news/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit