Detect String Between Python Function Example With A Loop