Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'odd': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Help': 0.11; 'jan': 0.12; '1),': 0.16; '>in': 0.16; 'intervening': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:python': 0.16; '>>>': 0.22; 'print': 0.22; 'integer': 0.24; 'url:home': 0.24; 'header:X -Complaints-To:1': 0.27; 'prints': 0.31; 'question:': 0.31; 'subject:with': 0.35; 'but': 0.35; 'sequence': 0.36; 'charset:us- ascii': 0.36; 'positive': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'negative': 0.60; 'first': 0.61; '100': 0.79; '2015': 0.84; 'repsonse': 0.84; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Help with map python 2 Date: Sun, 04 Jan 2015 12:32:22 -0500 Organization: IISS Elusive Unicorn References: <60e62263-6cd1-48b9-acbc-f1a0b947b8c9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-218-203.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420392749 news.xs4all.nl 2924 [2001:888:2000:d::a6]:49712 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83214 On Sun, 4 Jan 2015 03:34:21 -0800 (PST), flebber declaimed the following: >In repsonse to this question: Write a program that prints the first 100 members of the sequence 2, -3, 4, -5, 6, -7, 8. > >This is my solution it works but ugly. > Let's see... a sequence of positive even integer values, interspersed with the negative of the intervening odd integers... >>> for i in range(50): ... j = 2 * (i + 1) ... print j, -(j + 1), ... 2 -3 4 -5 6 -7 8 -9 10 -11 12 -13 14 -15 16 -17 18 -19 20 -21 22 -23 24 -25 26 -27 28 -29 30 -31 32 -33 34 -35 36 -37 38 -39 40 -41 42 -43 44 -45 46 -47 48 -49 50 -51 52 -53 54 -55 56 -57 58 -59 60 -61 62 -63 64 -65 66 -67 68 -69 70 -71 72 -73 74 -75 76 -77 78 -79 80 -81 82 -83 84 -85 86 -87 88 -89 90 -91 92 -93 94 -95 96 -97 98 -99 100 -101 >>> -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/