Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed8.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'assignment': 0.07; 'indexing': 0.07; 'strings.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thu,': 0.15; 'elements,': 0.16; 'function).': 0.16; 'message-id:@web.de': 0.16; 'received:188.174': 0.16; 'received:80.91.229.3': 0.16; 'received :mnet-online.de': 0.16; 'received:plane.gmane.org': 0.16; 'reversed': 0.16; 'strong,': 0.16; 'subject:assistance': 0.16; 'used:': 0.16; 'wrote:': 0.16; 'string': 0.17; 'beginner': 0.18; 'string,': 0.18; 'input': 0.18; '2015': 0.20; 'first,': 0.20; 'daniel': 0.23; 'split': 0.23; 'words': 0.24; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'example': 0.26; 'header:X-Complaints-To:1': 0.26; 'order.': 0.27; 'function': 0.28; '-0700,': 0.29; 'necessary,': 0.29; 'spaces': 0.29; 'help,': 0.32; 'maybe': 0.33; 'doubt': 0.33; 'list': 0.34; 'could': 0.35; 'done': 0.35; 'but': 0.36; 'too': 0.36; '(and': 0.36; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'display': 0.37; 'method': 0.37; 'received:org': 0.37; 'desired': 0.37; "won't": 0.38; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'subject:Need': 0.61; 'charset:windows-1252': 0.62; 'between': 0.65; 'reverse': 0.66; 'here': 0.66; 'jul': 0.72; 'denis': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sibylle Koczian Subject: Re: Need assistance Date: Sat, 18 Jul 2015 12:35:10 +0200 References: <225d4ac6-3b88-4844-805b-b4b00cd62ef4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ppp-188-174-164-192.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437215723 news.xs4all.nl 2915 [2001:888:2000:d::a6]:59316 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:94053 Am 18.07.2015 um 02:40 schrieb Denis McMahon: > On Thu, 16 Jul 2015 19:15:38 -0700, craig.sirna wrote: > >> The assignment wants us to take a users first, middle and last name in a >> single input ( name=('enter your full name: )). >> >> Then we must display the full name rearranged in Last, First Middle >> order. > > To generate a list of words from a string, split the string up on the > spaces between words. See the split method of strings. > > Having a list of words, get a copy of the list in reverse order. See the > reversed function (and maybe the list function). > That won't really help, because the desired order is, with the example the OP used: Sirna Daniel Craig. So here indexing is necessary, but indexing of the list elements, not of the characters in the string. (Necessary is too strong, because this could be done with rpartition. But I doubt that's the right answer for a beginner course.)