這個為什么不可以
score = 85 if score<60: ? ?print 'failed' elif score<80: print 'passed' elif scort<90: print 'good' else: print'excellent' 為什么不可以?????
score = 85 if score<60: ? ?print 'failed' elif score<80: print 'passed' elif scort<90: print 'good' else: print'excellent' 為什么不可以?????
2016-03-30
舉報
2016-08-31
注意關鍵字和代碼格式吧.邏輯沒問題.
2016-03-31
發現大家提問的時候,代碼都是不帶格式的。。。
樓主的代碼加了格式之后是這樣的:
首先要說明的是, 樓主的思路是沒有問題的;不僅沒有問題,而且很奇特! 哈哈,很喜歡這種腦洞大開的思路。
但是代碼里面有兩處錯誤,在本地跑一下就報出來了,mooc網的解釋器對接的不好,錯誤信息報不出來:
第六行:?elif scort<90: , 變量名寫錯了,應該是score.
最后一樣, print'excellent', 關鍵字print 后面要加空格嘛。
所以正確代碼如下:
2016-03-30
命令提示符中運行是可以的,可能跟網站的答案設置有關吧
2016-03-30
scort<90:寫錯啦 ?改成score<90:就行了
2016-03-30
這么寫有邏輯問題 ,80分以上應該是good才對 不是passed。