title: Python won't run program
body: <p>I'm new to python but have college experience in C# and Matlab. I am trying to write and run a dijkstras algorithm, but when I run it, nothing happens. I will attach the code (including commented out failed attempts) in hopes that someone can guide me in the right direction. </p>
  
  <pre><code>#must write script to turn matrix into this form of graph
  graph = {'a':{'c':3,'e':5},'c':{'a':3,'d':5},'d':{'c':3,'e':6},'e':
  {'d':6,'a':5}}
  unseenNodes = {}
  goal = {}
  start = {}
  
  
  #defining function
  def dijkstra(graph, start, goal):
      shortest_distance = {} #empty dictionary
      predeccesor = {} #empty dictionary 
      unseenNodes = graph #makes it run through til all are seen
      path = []
  def __init__(self):  
   #start node to next node
      print( str("hi"))
  
       for node in unseenNodes:
          shortest_distance[node]=9999999
          shortest_distance[start]=0
          print(shortest_distance)
  
  #beefy bit of dijkstras alogrithim 
      while unseenNodes:
          minNode=None
          for node in unseenNodes:
              if minNode is None:
                  minNode = node
  
              elif shortest_distance[node] &lt; shortest_distance[minNode]:
                  minNode = node
  
              for childNode, weight in graph [minNode].items():
                  if weight + shortest_distance[minNode] &lt; 
   shortest_distance[childNode]:
                      shortest_distance[childNode] = weight + shortest_distance[minNode]
  
                  predeccesor[childNode] = minNode
                  unseenNodes.pop(minNode)
  
                  print(shortest_distance)
  
  #reverse stack approach to trace path
      currentNode = goal
      while currentNode != start:
          try:
              path.insert(0,currentNode)
              currentNode = predeccesor[currentNode]
           except KeyError:
              print('path not valid')
          #break
  
          path.insert(0,start)
          if shortest_distance[goal] != infinity:
              #print(goal) 
              print('shortest distance is' + str(shortest_distance[goal]))
              print('path is' + str(path))
           else:
               Print('Something Went Wrong!')
  
  #break
  
  dijkstra(graph, 'a', 'd')
  </code></pre>