Question: 
Write a function to check if the given string starts with a substring using regex.


Model's Code:
import re

def check_substring(s, substr):
    if re.match(f'^{re.escape(substr)}', s):
        return 'string starts with the given substring'
    else:
        return 'string doesnt start with the given substring'



Sample Correct Code:
import re 
def check_substring(string, sample) : 
  if (sample in string): 
      y = "\A" + sample 
      x = re.search(y, string) 
      if x : 
          return ("string starts with the given substring") 
      else : 
          return ("string doesnt start with the given substring") 
  else : 
      return ("entered string isnt a substring")


Asserts:
assert check_substring("dreams for dreams makes life fun", "makes") == 'string doesnt start with the given substring'
assert check_substring("Hi there how are you Hi alex", "Hi") == 'string starts with the given substring'
assert check_substring("Its been a long day", "been") == 'string doesnt start with the given substring'


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

Test 823 of 974: 630/823 (76.54921020656136%): success