Create a Python dictionary for alphabetical order of numeric input
[2, 3, 1]
def createDict(arr):
  res = {}
  for i in range(len(arr)):
    res[arr[i]] = i + 1
  return res

d = createDict([2, 3, 1])
print(d)