Use of index

S

SUBHABRATA

Dear All,
I have a small question.
If I have code line like the following:

a1="God"
a2="God is always great"
a3=a2.index(a1)
a4=a2.find(a1)
a5=a2.split()
a6=a5.index(a1)
a7=a5.find(a1) # Invalid as find is applicable only in string but not
in list.
if a4>-1:
print "God may be always great"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top