a simple matches program in python