=====Function Descriptions=====
start() & end()

These expressions return the indices of the start and end of the substring matched by the group.

Code

>>> import re
>>> m = re.search(r'\d+','1234')
>>> m.end()
4
>>> m.start()
0

=====Problem Statement=====
You are given a string S.
Your task is to find the indices of the start and end of string k in S.

=====Input Format=====
The first line contains the string S.
The second line contains the string k.

=====Output Format=====
Print the tuple in this format: (start_index, end_index)

If no match is found, print (-1, -1).

Difficulty: introductory

Starter code:

# Enter your code here. Read input from STDIN. Print output to STDOUT

Solutions:
import re
s = input().strip()
k = input().strip()
s_len = len(s)
found_flag = False
for i in range(s_len):
    match_result = re.match(k,s[i:])
    if match_result:
        start_index = i+match_result.start()
        end_index = i+match_result.end()-1
        print((start_index,end_index))
        found_flag = True
if found_flag == False:
    print('(-1, -1)')


#!/usr/bin/env python3

import re

def __starting_point():
    string = input()
    sub = input()
    
    matches = list(re.finditer(r'(?={})'.format(sub), string))
    
    if matches:
        for match in matches:
            print((match.start(), match.end() + len(sub) - 1))
    else:
        print((-1, -1))
__starting_point()