While Loop With Range Python Parameters In Functions