Java While Loop Through Array Python