Re: [Tutor] string split function - how to tell how many splits

2011-11-08 Thread Dave Angel
On 11/08/2011 11:56 AM, Cranky Frankie wrote: How do you tell how many splits the string split funtion returns? For example: field = 'The Good Wife ;' # a string separated by spaces new_list = field.split(' ') # create a list of space delimited elements print (new_list[0])

Re: [Tutor] string split function - how to tell how many splits

2011-11-08 Thread Steven D'Aprano
Cranky Frankie wrote: How do you tell how many splits the string split funtion returns? For example: field = 'The Good Wife ;' # a string separated by spaces new_list = field.split(' ') # create a list of space delimited elements print (new_list[0]) # print the first one pr

Re: [Tutor] string split function - how to tell how many splits

2011-11-08 Thread Joel Goldstick
On Tue, Nov 8, 2011 at 11:56 AM, Cranky Frankie wrote: > How do you tell how many splits the string split funtion returns? For > example: > > field = 'The Good Wife ;' # a string separated by spaces > new_list = field.split(' ') # create a list of space delimited elements > print (new_li

[Tutor] string split function - how to tell how many splits

2011-11-08 Thread Cranky Frankie
How do you tell how many splits the string split funtion returns? For example: field = 'The Good Wife ;' # a string separated by spaces new_list = field.split(' ') # create a list of space delimited elements print (new_list[0]) # print the first one print (new_list[1])