我的代碼可以在這裏找到:https://github.com/thekarangoel/HackerNewsAPI/blob/master/hn.py爲什麼我的代碼打印'無'?
測試用例是這樣的:
from hn import HN
hn = HN()
for story in hn.get_top_stories()[:10]:
print story.print_story()
print '*' * 50
print ''
這將打印像這樣我的輸出:
.....
.....
.....
**************************************************
Rank: 3
Story ID: 6231993
Title: Pipe Dream? 3D-Printed Model of Hyperloop Created
Link: http://news.yahoo.com/pipe-dream-3d-printed-model-hyperloop-created-192033757.html
Domain: yahoo.com
Points: 1
Submitted by: evo_9
Number of comments: 0
Link to comments: http://news.ycombinator.com/item?id=6231993
None
**************************************************
Rank: 4
Story ID: 6231992
Title: What colour are your bits?
Link: http://ansuz.sooke.bc.ca/entry/23
Domain: bc.ca
Points: 1
Submitted by: grey-area
Number of comments: 0
Link to comments: http://news.ycombinator.com/item?id=6231992
None
.....
.....
通知的None
在每次打印結束?爲什麼在那裏?代碼有什麼問題?