Formatting lists in erlang
I am very new to erlang. I am trying to print a list to the console.
This is what I am able to do currently and stuck up.
I'm trying this out in the erl.
>List = [{"a",20},{"b", 30}].
[{"a",20},{"b",30}]
>lists:foreach( fun(H) -> io:format("~p~n", [H]) end, List).
{"a",20}
{"b",30}
I am interested in formatting each list there. I want the output to be of
the form
"a" - 20
"b" - 30
I am not knowing how would I be able to access the lists in a list and
format them as I want them to be. Any kind help would be greatly
appreciated.
No comments:
Post a Comment