if-elif-else
score = 85
if score>=90:
? ? print 'excellent'
elif score>=80:
? ? print 'good'
elif score>=60:
? ? print 'passed'
else:
? ? print 'failed'
這個85也會大于60 為什么只輸出大于80 的good 不會輸出大于60 的passed
score = 85
if score>=90:
? ? print 'excellent'
elif score>=80:
? ? print 'good'
elif score>=60:
? ? print 'passed'
else:
? ? print 'failed'
這個85也會大于60 為什么只輸出大于80 的good 不會輸出大于60 的passed
2016-11-09
舉報
2016-11-09
因為elif score>=80 滿足條件后不在往后執行了