Prolog Avg of List
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.