Elixir: Printing list along with string

Viewed 13302

I would like to print a list along with a string identifier like

list = [1, 2, 3]
IO.puts "list is ", list

This does not work. I have tried few variations like

# this prints only the list, not any strings
IO.inspect list
# using puts which also does not work
IO.puts "list is #{list}" 

In javascript, I could simply do console.log("list is ", list). I'm confused how I could achieve the same in elixir.

2 Answers
Related