How to print alphabet in Elixir? (aa ab ac etc)

Since op wants to print each pair, I would do it like below. Also your use of the charlist is a bit non-idiomatic imo.

alphabet = ~w(a b c d e f g h i j k l m n o p q r s t u v w x y z)

Enum.each(alphabet, fn letter ->
  IO.puts("a#{letter}")
end)
4 Likes