Hi, there are two list fs, fi;:
fs = Range[6]; fi = {"a", "b", "c", "d", "u", "y"};
I would like to create following list more efficiently not input again:
{1 -> "a", 2 -> "b", 3 -> "c", 4 -> "d", 5 -> "u", 6 -> "y"}
How to do
Try:
MapIndexed[First[#2] -> #1 &, fi]
or:
Thread[fs -> fi]
thank you! it is cute code