Mercurial > fragmenty
changeset 23:7eefbd0a3068
nie używamy nazw buildinów
| author | Radomir Dopieralski |
|---|---|
| date | Wed, 31 Oct 2012 12:33:18 +0100 |
| parents | f98fa2de8fa9 |
| children | 640667a240c9 |
| files | docs/Szukanie%20yap-%C3%B3w |
| diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/docs/Szukanie%20yap-%C3%B3w Wed Oct 31 12:31:57 2012 +0100 +++ b/docs/Szukanie%20yap-%C3%B3w Wed Oct 31 12:33:18 2012 +0100 @@ -1,8 +1,8 @@ {{{#!python ->>> input = u'yap foo yup bar yep yelp' ->>> for prev, this, next in zip(input, input[1:], input[2:]): -... if prev.lower() == 'y' and next.lower() == 'p': -... print prev+this+next +>>> data = u'yap foo yup bar yep yelp' +>>> for prev_item, this_item, next_item in zip(data, data[1:], data[2:]): +... if prev_item.lower() == 'y' and next_item.lower() == 'p': +... print prev_item + this_item + next_item ... yap yup
