瀏覽代碼

Change print statements to functions

John Tyree 11 年之前
父節點
當前提交
499fa7723f
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      composite.py
  2. 3 3
      graph_search.py

+ 1 - 1
composite.py

@@ -273,7 +273,7 @@ class CompositeDict(SpecialDict):
 
 
         child = self.getChild(name)
         child = self.getChild(name)
         if child:
         if child:
-            # print 'Child %s present!' % name
+            # print('Child %s present!' % name)
             # Replace it if force==True
             # Replace it if force==True
             if force:
             if force:
                 index = self.getIndex(child)
                 index = self.getIndex(child)

+ 3 - 3
graph_search.py

@@ -75,6 +75,6 @@ graph = {'A': ['B', 'C'],
 graph1 = GraphSearch(graph)
 graph1 = GraphSearch(graph)
 
 
 
 
-print graph1.find_path('A', 'D')
-print graph1.find_all_path('A', 'D')
-print graph1.find_shortest_path('A', 'D')
+print(graph1.find_path('A', 'D'))
+print(graph1.find_all_path('A', 'D'))
+print(graph1.find_shortest_path('A', 'D'))