The length operator accepts a set, list or string as a parameter and returns the length of the object.
> numbers := [1, {2, 3}, [4, {5, 6}]]; # a list with 3 elements > length(numbers); # 1st -> 1 # 2nd -> {2,3} # 3rd -> [4, {5, 6}] 3 > length('I have length 16'); # a string 16We can use length function to remove the last element of a list.
> length(weekdays); 5 > shortweek := weekdays[1..length(weekdays)-1]; # taking Friday off shortweek := [monday, tuesday, wednesday, thursday]