In addition to the aforementioned functions, you can use pattern matching and the cons operator | to split a list into head and tail; we’ll learn more about this pattern in later lessons:
iex> [h|t] = [3.14, :pie, "Apple"]
[3.14, :pie, "Apple"]
iex> h
3.14
iex> t
[:pie, "Apple"]
Comprehension:
for x <- 0..10, do: IO.puts x