Question: 
Write a function that matches a word at the beginning of a string.


Model's Code:
def text_match_string(s):
    if s.lstrip().startswith("python"):
        return 'Found a match!'
    else:
        return 'Not matched!'



Sample Correct Code:
import re
def text_match_string(text):
        patterns = '^\w+'
        if re.search(patterns,  text):
                return 'Found a match!'
        else:
                return 'Not matched!'


Asserts:
assert text_match_string(" python")==('Not matched!')
assert text_match_string("python")==('Found a match!')
assert text_match_string("  lang")==('Not matched!')


Tests:
Test 1 of 3: FAIL: AssertionError()

Test 44 of 974: 33/44 (75.0%): failed