fork download
  1. def find_last(string_search, string_target):
  2. position = 0
  3. while position != -1:
  4. position = string_search.find(string_target, position+1 )
  5. if position != -1:
  6. end_pos = position
  7. return end_pos
  8.  
  9. print find_last("aaaa","a")
  10. print find_last("zz", "a")
Runtime error #stdin #stdout 0.02s 6356KB
stdin
Standard input is empty
stdout
3