Posts by Jonnathan Lopes • 41 points
2 posts
-
3
votes1
answer257
viewsQ: Creation of Graph in Dictionary form returning integers
I am implementing a Python code for Graph creation with open (filename, "r") as f: d = {} for line in f: key, value = line.split() if key not in d: d[key] = [value] else: d[key].append(value)…
-
1
votes1
answer1156
viewsQ: Read txt with numbers and create a Python dictionary
Good afternoon I’m trying to create a Graph from a Txt file but in the generated dictionary the numbers are coming out as if they were strings someone can help me , follows the code : txt file ` 0 1…