Java Get String Length Python Function Example With A Loop