Notes

Source: 📖 Python Cookbook ch2.2 p38


Checking the start or end of a string with .startswith() and .endswith()



filename = 'spam.txt'

filename.endswith('.txt')	# True
filename.startswith('foo')	# False