RosettaCodeData/Task/Hash-from-two-arrays/Mathematica/hash-from-two-arrays.math
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

7 lines
142 B
Text

Map[(Hash[Part[#, 1]] = Part[#, 2]) &,
Transpose[{{1, 2, 3}, {"one", "two", "three"}}]]
?? Hash
->Hash[1]=one
->Hash[2]=two
->Hash[3]=three