[Tutor] List Python Question..Please help

Jacqueline Canales jackiexxduh3 at gmail.com
Sat Sep 28 07:55:41 CEST 2013


THANK YOU!!!!!!! All of you were very helpful!! Will definitely use you
guys again for any other issues, glad you challenged me to think rather
than giving me the answer!!!


On Sat, Sep 28, 2013 at 12:39 AM, Amit Saha <amitsaha.in at gmail.com> wrote:

> On Sat, Sep 28, 2013 at 3:36 PM, Jacqueline Canales
> <jackiexxduh3 at gmail.com> wrote:
> > Thank you guys so much i was able to figure it out. I definitely thought
> to
> > much into the the problem and made it harder on myself. Cant thank you
> > enough for assisting me. I have one more problem with the coding tho.
> >
> > composers = ['Antheil', 'Saint-Saens', 'Beethoven', 'Easdale', 'Nielsen']
> > new_list = []
> > person = new_list
> > for person in composers:
> >     if person[0].lower() == person[-1].lower():
> >         print(person)
> >
> > Output:
> > Saint-Saens
> > Easdale
> > Nielsen
>
> Great work!
>
> >
> > composers = ['Antheil', 'Saint-Saens', 'Beethoven', 'Easdale', 'Nielsen']
> > new_list = []
> > person = new_list
> > for person in composers:
> >     if person[0].lower() == person[-1].lower():
> >         new_list.append(person)
> >         print(new_list)
> >
> > output:
> > ['Saint-Saens']
> > ['Saint-Saens', 'Easdale']
> > ['Saint-Saens', 'Easdale', 'Nielsen']
>
>
>
> >
> > How can i make the output of the names into just one individual list.
>
> You mean, just print it once? The last line of your output?
>
> Just print after the loop is over.
>
>
>
>
>
> --
> http://echorand.me
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130928/2bf1b462/attachment-0001.html>


More information about the Tutor mailing list