Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86237

Re: Concatenate list values

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <aberg010@my.HennepinTech.edu>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.106
X-Spam-Level *
X-Spam-Evidence '*H*': 0.79; '*S*': 0.00; 'tutorial': 0.03; 'strings.': 0.09; 'concatenate': 0.16; 'subject:values': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'header:User-Agent:1': 0.23; 'string,': 0.24; 'appreciated': 0.26; 'values': 0.27; 'header:In- Reply-To:1': 0.27; 'subject:list': 0.30; 'received:10.0.0': 0.31; 'trivial': 0.31; 'url:python': 0.33; 'problem': 0.35; 'except': 0.35; 'problem.': 0.35; 'there': 0.35; 'next': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'should': 0.36; 'list': 0.37; 'received:10': 0.37; 'lists.': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'solve': 0.60; 'length': 0.61; 'url:3': 0.61; 'simple': 0.61; 'first': 0.61; 'covers': 0.68; 'ample': 0.91; 'lists:': 0.91
Date Mon, 23 Feb 2015 10:14:04 -0600
From Andrew Berg <aberg010@my.hennepintech.edu>
User-Agent Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
MIME-Version 1.0
To <python-list@python.org>
Subject Re: Concatenate list values
References <12821378-62af-4954-8b61-aa0738c5ff5c@googlegroups.com>
In-Reply-To <12821378-62af-4954-8b61-aa0738c5ff5c@googlegroups.com>
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding 7bit
X-Originating-IP [73.5.142.244]
X-ClientProxiedBy CY1PR00CA0021.namprd00.prod.outlook.com (25.160.142.159) To DM2PR0301MB0845.namprd03.prod.outlook.com (25.160.215.143)
Authentication-Results spf=none (sender IP is ) smtp.mailfrom=aberg010@my.HennepinTech.edu;
X-Microsoft-Antispam UriScan:;
X-Microsoft-Antispam BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0845;
X-Microsoft-Antispam-PRVS <DM2PR0301MB0845F8493B16F95EA88B2ACA81290@DM2PR0301MB0845.namprd03.prod.outlook.com>
X-Exchange-Antispam-Report-Test UriScan:;
X-Exchange-Antispam-Report-CFA-Test BCL:0; PCL:0; RULEID:(601004)(5005003); SRVR:DM2PR0301MB0845;
X-Forefront-PRVS 0496DF6962
X-Forefront-Antispam-Report SFV:NSPM; SFS:(10019020)(6049001)(6009001)(51704005)(199003)(189002)(24454002)(50466002)(64126003)(105586002)(47776003)(97736003)(2950100001)(77096005)(87976001)(86362001)(66066001)(65956001)(64706001)(80316001)(19580395003)(65806001)(68736005)(15975445007)(42186005)(75432002)(92566002)(46102003)(110136001)(89122001)(83506001)(40100003)(122386002)(107886001)(2351001)(106356001)(76176999)(54356999)(50986999)(65816999)(87266999)(88552001)(33656002)(450100001)(59896002)(62966003)(77156002)(101416001)(23676002)(89472002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0845; H:[10.0.0.21]; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:1; LANG:en;
Received-SPF None (protection.outlook.com: my.HennepinTech.edu does not designate permitted sender hosts)
X-Exchange-Antispam-Report-CFA-Test BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0845;
X-OriginatorOrg my.hennepintech.edu
X-MS-Exchange-CrossTenant-OriginalArrivalTime 23 Feb 2015 16:14:10.8602 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader Hosted
X-MS-Exchange-Transport-CrossTenantHeadersStamped DM2PR0301MB0845
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.19082.1424708919.18130.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1424708919 news.xs4all.nl 2879 [2001:888:2000:d::a6]:32800
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:86237

Show key headers only | View raw


On 2015.02.23 09:58, loial wrote:
> Is there a quick way to concatenate all the values in a list into a string, except the first value?
> 
> I want this to work with variable length lists.
> 
> All values in list will be strings.
> 
> Any help appreciated
> 
The tutorial covers strings and lists:
https://docs.python.org/3/tutorial/introduction.html#strings
And there is ample reference documentation for strings and lists:
https://docs.python.org/3/library/stdtypes.html#string-methods
https://docs.python.org/3/library/string.html
https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range

Get to know strings and lists, and this should be a trivial problem to solve.

Or just copy/paste the answers others gave and be confused the next time you
need to solve a simple problem.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Concatenate list values loial <jldunn2000@gmail.com> - 2015-02-23 07:58 -0800
  Re: Concatenate list values John Gordon <gordon@panix.com> - 2015-02-23 16:07 +0000
  Re: Concatenate list values alister <alister.nospam.ware@ntlworld.com> - 2015-02-23 16:08 +0000
  Re: Concatenate list values Peter Otten <__peter__@web.de> - 2015-02-23 17:09 +0100
  Re: Concatenate list values Tim Chase <python.list@tim.thechases.com> - 2015-02-23 10:14 -0600
  Re: Concatenate list values Andrew Berg <aberg010@my.hennepintech.edu> - 2015-02-23 10:14 -0600
  Re: Concatenate list values Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-02-23 17:13 +0000
    Re: Concatenate list values wxjmfauth@gmail.com - 2015-02-24 02:30 -0800
  Re: Concatenate list values loial <jldunn2000@gmail.com> - 2015-02-24 00:37 -0800

csiph-web