Sorry, I'm just starting to learn mathematica.
I have the following two-argument function:
h[{x_, y_}] := x ^ y
When I do the following:
Map[h, {{1, 2}, {2, 2}, {3, 2}}]
I get the expected output:
{1, 4, 9}
I was wondering what I'm doing wrong with the following rewrite of the above map expression (I want to learn how to use #1
... #n
's):
#1 ^ #2 & /@ {{1, 2}, {2, 2}, {3, 2}}
the error messages I'm getting are:
Function::slotn: "Slot number 2 in #1^#2& cannot be filled from (#1^#2&)[{1,2}]"
Function::slotn: "Slot number 2 in #1^#2& cannot be filled from (#1^#2&)[{2,2}]."
Function::slotn: "Slot number 2 in #1^#2& cannot be filled from (#1^#2&)[{3,2}]."