On Sat, 03 Aug 2013 15:17:42 -0700, eschneider92 wrote:

> pie='apple keylime pecan meat pot cherry'

That sets pie to a string containing multiple words.

> pie.split()

This splits pie into individual words, then immediately throws the result 
away, leaving pie still set to a string. Instead, you want to do this:

pie = pie.split()

Now pie will be a list of individual words. You can print the entire list:

print(pie)


or print each word separately:


for filling in pie:
    print(filling)


Or pick out one specific filling:


print(pie[2])  # should print 'pecan'


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to