課程
/后端開發
/Python
/初識Python
score = 75
if score >= 60:
? ? print 'passed'
print 'not passed'
為什么我輸出的內容是passed和not passed呢?不應該只輸出passed嗎?
2018-06-28
源自:初識Python 5-1
正在回答
Why???? ?還有題目人名是Bart,用score替換就可以了吧。? 大神快來圍觀
else:
? ? print 'not passed'
python是嚴格要求語法格式,你print 'not passed'在機器看來就表示這是一個打印輸出的語句,而不是if判斷循環的語句要執行的內容
你應該
else
?????print 'not passed'
這樣寫
少了else
舉報
學python入門視頻教程,讓你快速入門并能編寫簡單的Python程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-10-17
2018-07-01
score = 75
if score >= 60:
? ? print 'passed'
else:
? ? print 'not passed'
2018-06-29
python是嚴格要求語法格式,你print 'not passed'在機器看來就表示這是一個打印輸出的語句,而不是if判斷循環的語句要執行的內容
你應該
score = 75
if score >= 60:
? ? print 'passed'
else
?????print 'not passed'
這樣寫
2018-06-28
少了else