Prolog AVG de la liste
average( List, Average ):-
sum( List, Sum ),
length( List, Length ),
Length > 0,
Average is Sum / Length.
Stormy Sloth
average( List, Average ):-
sum( List, Sum ),
length( List, Length ),
Length > 0,
Average is Sum / Length.