python错误之AttributeError: 'NoneType' object has no attribute 'enter'

今日在学习python时遇到一个问题:

AttributeError: 'NoneType' object has no attribute 'enter'

 

一直都找不到问题,后来请教了一个朋友,他说是运行到那一行的时候,current scene是None

 

原代码是我输入“tell a joke”,会返回下个场景a的具体值,然后我突然就意识到我应该是返回的场景a的值是错的,一看,果然是的

 

posted on 2017-12-10 21:37  fifi_zh  阅读(10214)  评论(0)    收藏  举报