I have a dictionary as
maketh = {'n':['1', '2', '3'], 'g': ['0', '5', '6', '9'], 'ca': ['4', '8', '1', '5', '9', '0']}
which I intend to change to
maketh_new = {'n':[1, 2, 3], 'g': [0, 5, 6, 9], 'ca': [4, 8, 1, 5, 9, 0]}
The order in which the numbers are in the values are very important. So, the order should remain the same even after they are changed.
The error I always get when I try to change it using any method available online is:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
"If there is any typing mistake pls ignore it..."
One that I wrote on my own thinking that may be something like this can work was:
maketh_new = dict()
for (key, values) in maketh.items():
for find in len(values):
maketh_new [key] = int(values[find])
I tried it thinking if I can access all the elements of the values that are in the list as a string then I may be able to type caste it into int. But I get an error as:
'list' object cannot be interpreted as an integer
So if someone can help me find a solution, please do it...