Sorting with lambda function for a key is not working

Sorting with lambda function for a key is not working if set is in braces why?
eg:
a = [{“a”, 2}, {“b”, 1}, {“c”, 4}]
sorted(a, key = lambda x: x[1]) <- doesn’t work
b =[ (“jatin”, 2), (“b”, 1), (“c”, 4)]
sorted(b, key = lambda x: x[1]) -> works