Question: 
Write a function to find the occurrence and position of the substrings within a string.


Model's Code:
def occurance_substring(s, substring):
    start = s.find(substring)
    if start == -1:
        return None
    return (substring, start, start + len(substring))



Sample Correct Code:
import re
def occurance_substring(text,pattern):
 for match in re.finditer(pattern, text):
    s = match.start()
    e = match.end()
    return (text[s:e], s, e)


Asserts:
assert occurance_substring('python programming, python language','python')==('python', 0, 6)
assert occurance_substring('python programming,programming language','programming')==('programming', 7, 18)
assert occurance_substring('python programming,programming language','language')==('language', 31, 39)


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 773 of 974: 585/773 (75.67917205692109%): success