#coding:utf-8
 #operation of strings
 
 a ="hello, world"
 
 
 txt = input("文章を入力して下さい")
 pattern =input("パターンを入力して下さい")
 
 ans1 = txt.find(pattern)
 ans2 = txt.rfind(pattern)
 ans3 = txt.index(pattern)
 ans4 = txt.rindex(pattern)
 ans=ans4
 if ans == -1:
     print("見つからなかった")
 else:
     print("見つかりました。"+str(ans)+"番目にある。")
                     

        
実行結果