![]() |
|
Navigation |
Synopsis Drop elements from the head of a list.
Function
list[&T] drop(int n, list[&T] lst)
Usage
import List;
Description Drop
n elements (or size(lst) elements if size(lst) < n ) from the head of lst .
See take to get elements from the head of a list].
Examples
rascal>import List; ok rascal>drop(2, [5, 1, 7, 3]); list[int]: [7,3] rascal>drop(10, [5, 1, 7, 3]); list[int]: [] rascal>drop(2, ["zebra", "elephant", "snake", "owl"]); list[str]: ["snake","owl"] Questions
Question [1].
![]() ![]() n elements from a list returns a list with
Question [2].
![]() ![]()
Question [3].
![]() ![]() ![]() |