When I use some function, at the end along with the output I get some NULLs returned that I don't understand the reason for and are highly undesirable. For example, inwhen I define the reversal of list with
ReverseList[ele_List] := Module[{list = List[], i, k = 1}, {For[i = Length[ele], i > 0, {i--, k++}, {AppendTo[list, ele[[i]]]}], Print[list], Return[list]} ] The output I get
ReverseList[{1, 2, 3, 4, 5}] is
{5,4,3,2,1} {Null, Null, Return[{5, 4, 3, 2, 1}]} I am also facinghave a problem with returning the list. Can someone please help me with these two problems I am facing.?