Java While Loop Through Array Python Definition