You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
219 B
9 lines
219 B
5 years ago
|
List myAvg := method(
|
||
|
if(isEmpty, 0, (self sum) / (self size))
|
||
|
)
|
||
|
|
||
|
list(0, 100) myAvg println # 50
|
||
|
list(100) myAvg println # 100
|
||
|
list() myAvg println # 0
|
||
|
list(1,2,"three") myAvg println # Error
|