Python Function Inside Array Definition