I have a dictionary, the values of which are represented by a list of strings containing integers: {35: ["85", "95"]} .
Using this code, I wanted to replace all string values with similar integers:
TempList = [] for key in graph: for value in graph[key]: if isinstance(value, str): TempList.extend(int(value)) graph.setdefault(key, TempList) But TypeError: 'int' object is not iterable gets out TypeError: 'int' object is not iterable I don’t understand why this error gets out and how to fix it.
Thanks in advance for your help.