Python Function Using Global Variable