Using.find

This is the place for queries that don't fit in any of the other categories.

Using.find

Postby el_manu » Sat Sep 07, 2013 10:04 am

Code: Select all
[code]a = 'help me please can you help me?'
index = a.find('you')
index2 = a.find('me')
print(a[index + 4:index2 - 1])[/code]


i want to print what is between the you and me.

how can i do this using .find, as this only finds the first me and you in the phrase

is it possible

Stop spamming posts if you have nothing relevant to say. "I need this urgently" is definitely not relevant.
stranac
el_manu
 
Posts: 87
Joined: Mon Aug 19, 2013 8:30 am

Re: Using.find

Postby el_manu » Sat Sep 07, 2013 12:03 pm

do not stressssssss i worked it out.
el_manu
 
Posts: 87
Joined: Mon Aug 19, 2013 8:30 am

Re: Using.find

Postby Somelauw » Sat Sep 07, 2013 12:31 pm

el_manu wrote:do not stressssssss i worked it out.


Why not post the solution in case someone in the future has the same problem and finds this thread?
Join the #python-forum IRC channel on irc.freenode.net!
Somelauw
 
Posts: 73
Joined: Tue Feb 12, 2013 8:30 pm


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 2 guests