Run
import re str = 'Python is a programming language.' #search using regex x = re.search('^Python', str) if(x!=None): print('The line starts with \'Python\'.') else: print('The line does not start with \'Python\'.')
Output