Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.069 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.01; 'subject:string': 0.09; 'cc:addr:python-list': 0.11; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'wrote:': 0.18; 'written': 0.21; 'cc:addr:gmail.com': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**1': 0.23; 'header:In-Reply-To:1': 0.27; 'charset:us-ascii': 0.36; 'list': 0.37; 'thank': 0.38; 'address': 0.63; 'thomas': 0.65; 'to:addr:gmail.com': 0.65; 'dan.': 0.84; 'perfect!': 0.84; 'received:50.22': 0.84 Date: Fri, 24 May 2013 18:19:40 -0500 From: Tim Chase To: Thomas Murphy Subject: Re: Prepending string "@" to usernames In-Reply-To: References: X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: Python 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369437469 news.xs4all.nl 15900 [2001:888:2000:d::a6]:54124 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45928 On 2013-05-24 19:04, Thomas Murphy wrote: >> raw_address = "cookielover93 TheGermanHatesSaurkraut >> WhatsThatBoy932834" address_library = raw_address.split() >> print address_library >> >> final_address = [] >> for address in address_library: >> final_address.append("@" + str(address)) >> print final_address >> > Exactly it. Thank you so much Dan. Perfect! Which can be tidily written as a list comprehension: final_address = ['@' + address for address in raw_address.split()] -tkc