Skip to main content
4 of 16
added another way of getting the result
bmf
  • 17k
  • 2
  • 32
  • 68

We define

list = {x, x^2, x^3};
rules = {x -> 1, x -> 2, x -> 3};

and then

Inner[ReplaceAll, list, rules, List]
ReplaceAll @@@ Thread[{list, rules}]
Table[list[[i]] /. rules[[i]], {i, Length@rules}]
fnctn = #1 /. #2 & @@@ Transpose@({##}) &;

fnctn[list, rules]
MapIndexed[#^# &, Range@Length@list]
Last /@ Power[List @@@ rules, Range[Length@rules]]

all of the above give

{1, 4, 27}

bmf
  • 17k
  • 2
  • 32
  • 68