=====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).
#!/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()
#!/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()