Python String Prefix Match, takewhile() combined with zip() for a more flexible approach, or iterative comparison.