[Tutor] how to add string into the specified position of the original string

Bob Gailer bgailer at alum.rpi.edu
Sun Oct 24 02:43:26 CEST 2004


At 06:32 PM 10/23/2004, Lin Jin wrote:
>if i define a function:
>def setposition(post,outter,string):
>
>i want to call the function setposition(3,"S", "0S0 0SSSS") that return 
>the"OSOSOSSSS"
>HOW COULD I DEFINE THE FUNCTION TO MAKE THAT.THX

I can't determine the desired behavior from the example. Please explain. 
The closest I can imagine is that you want to replace the character in 
position post with outter. The names make it a little hard to understand, 
and how/why do the zeroes get replaced with ohs?


Bob Gailer
bgailer at alum.rpi.edu
303 442 2625 home
720 938 2625 cell 



More information about the Tutor mailing list