Re: Indexing strings

2005-03-05 Thread Patrick Useldinger
Fred wrote: That was exactely what I was searching for. I needed a program, that chopped up a string into its words and then saves them into a list. I think I got this done... There's a function for that: text.split(). You should really have a look at the Python docs. Also, http://diveintopython.o

Re: Indexing strings

2005-03-04 Thread Fred
> Use the index method, e.g.: text.index(' '). > What exactly do you want to do? That was exactely what I was searching for. I needed a program, that chopped up a string into its words and then saves them into a list. I think I got this done... Thanks for the help -- http://mail.python.org/mailma

Re: Indexing strings

2005-03-04 Thread Steve Holden
Fred wrote: Hi everybody I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to fin

Re: Indexing strings

2005-03-04 Thread Patrick Useldinger
Fred wrote: I am searching for a possibility, to find out, what the index for a certain lettyer in a string is. My example: for x in text: if x == ' ': list = text[: # There I need the index of the space the program found during the loop... Is there and possibility to find the index o