<div dir="ltr">First, thank you because this is a great resource. <div><br></div><div>Second, I started writing basic programs every day to improve my Erlang coding. I wrote a simple program that calculates the average of a list of numbers. But I keep getting this error about io:format.</div><div><br></div><div><br></div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:menlo;font-size:9pt"><span style="background-color:rgb(52,65,52)">prices</span>([]) -><br>    [],<br>    io:format(<span style="color:rgb(106,135,89)">"List is empty ~n"</span>);<br><br><span style="color:rgb(128,128,128)">%% determine number of items in the list to calculate average%%<br></span><span style="color:rgb(128,128,128)"><br></span>prices(<span style="color:rgb(152,118,170)">L</span>) <span style="color:rgb(204,120,50);font-weight:bold">when </span>is_list(<span style="color:rgb(152,118,170)">L</span>) -><br>  <span style="color:rgb(152,118,170)">Size </span>= length(<span style="color:rgb(152,118,170)">L</span>),<br>  <span style="color:rgb(152,118,170)">Sum1 </span>= lists:sum(<span style="color:rgb(152,118,170)">L</span>),<br>  <span style="color:rgb(152,118,170)">Av1 </span>= <span style="color:rgb(152,118,170)">Sum1 </span>/ <span style="color:rgb(152,118,170)">Size</span>,<br>  io:format(<span style="color:rgb(106,135,89)">"The average equals ~n"</span>, <span style="color:rgb(152,118,170)">Av1</span>)<span style="color:rgb(204,120,50);font-weight:bold">.</span></pre></div><div><div><br></div><div>Then..</div></div><div><br></div><div><div>Eshell V8.2  (abort with ^G)</div><div>1> L = [1,2,2,2,3,3,4].</div><div>[1,2,2,2,3,3,4]</div><div><br></div><div>2> c(standev).</div><div>{ok,standev}</div><div><br></div><div>3> standev:prices(L).</div><div>** exception error: bad argument</div><div>     in function  io:format/3</div><div>        called as io:format(<0.50.0>,"The average equals ~n",2.4285714285714284)</div></div><div><br></div><div><br></div><div>Why am I getting '**exception error:'?</div><div><br></div><div>Thank you, I hope this isn't too newbie a question.</div><div><br></div><div><br></div><div><br></div></div>