To check whether a string starts with XXXX you can use startswith() function below is the code that illustrates the use of startswith() function:-
startswith():-
Syntax of function is str.startswith(search_string, start, end) where the first argument is the string to be searched, second and third arguments are optional in case you want to search the string from any fixed index then you need to put the second and third argument in the function.
abc_string = "hello world"
abc_string.startswith("hello")