Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'method.': 0.05; 'assignment': 0.07; 'indexing': 0.07; 'lost.': 0.09; 'python': 0.10; 'index': 0.13; 'syntax': 0.13; 'times,': 0.13; 'all?': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'index.': 0.16; 'input.': 0.16; 'subject:assistance': 0.16; 'with?': 0.16; 'wrote:': 0.16; 'string': 0.17; 'shell': 0.18; 'input': 0.18; '>>>': 0.20; 'first,': 0.20; 'space.': 0.22; 'code.': 0.23; 'bit': 0.23; 'daniel': 0.23; 'this:': 0.23; "haven't": 0.24; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'appreciated.': 0.27; 'figure': 0.27; 'order.': 0.27; 'correct': 0.28; 'function': 0.28; 'index,': 0.29; 'spaces': 0.29; "i'm": 0.30; 'code': 0.30; 'post': 0.31; "can't": 0.32; 'maybe': 0.33; "i'll": 0.33; 'message-id:@gmail.com': 0.34; 'next': 0.35; 'something': 0.35; 'sometimes': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'method': 0.37; 'received:org': 0.37; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'your': 0.60; 'subject:Need': 0.61; 'email addr:gmail.com': 0.62; 'show': 0.62; 'back': 0.62; 'charset:windows-1252': 0.62; 'spot': 0.63; 'incorporate': 0.66; 'talking': 0.67; 'gotten': 0.76; 'about?': 0.84; 'homework': 0.84; 'slicing?': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Thu, 16 Jul 2015 20:40:35 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Need assistance References: <225d4ac6-3b88-4844-805b-b4b00cd62ef4@googlegroups.com> In-Reply-To: <225d4ac6-3b88-4844-805b-b4b00cd62ef4@googlegroups.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437100840 news.xs4all.nl 2907 [2001:888:2000:d::a6]:46324 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!news.stben.net!border1.nntp.ams1.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:93976 On 07/16/2015 08:15 PM, craig.sirna@gmail.com wrote: > I need help writing a homework program. > > I'll write it, but I can't figure out how to incorporate what I have > read in the book to work in code. Can you post the code that you are currently working with? > 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. > > I tried to use the search function in Python to locate any spaces in > the input. It spot back the index 5 (I used Craig Daniel Sirna) Which search function are you talking about? Is it a string method or something else? One of the first string methods I learned about when I first started with Python was the .split() method. For example, in the interactive shell try this: >>> a="one,two,three" >>> a.split(',') Does this help at all? > That is correct for the first space, but I can't figure out how to > get it to continue to the next space. > The indexing process is also a bit confusingto me. Which part of indexing is confusing? The syntax for slicing? I admit I sometimes find it a bit complicated to know when and where to use -1 as the index. > I get that I can use len(fullName) to set the length of the index, > and how the index is counted, but after that I'm lost. > > I have emailed my professor a few times, but haven't gotten a > response.(online course) > > Any help would be greatly appreciated. Again, show us the code you have so far and maybe we can help you figure it out.