-2
我無法解釋以下行爲相應的打印語句。如果語句只執行當三個已運行
可有人請向我解釋爲什麼,當我運行下面的程序,用戶可以路輸入三個不正確的答案,這應該讀「不正確」 print語句不打印,直到循環的結束?
def main():
UserName = input ('What is your name?')
UserAge = input ('What is your age?')
sum1 = input ('What is 3 x 3?')
sum2 = input ('What is 1 + 7?')
sum3 = input ('What is 9 - 8?')
if sum1 =='9':
print('Correct1')
else:
print ('Incorrect1')
if sum2 =='8':
print('Correct2')
else:
print ('Incorrect2')
if sum3 =='1':
print('Correct3')
else:
print ('Incorrect3')
if __name__ == '__main__':
main()
什麼語言? – 2014-09-29 12:34:02
沒有反應 - 標記爲'python'現在... – 2014-09-29 14:44:16
這python3可能是因爲打印語句 – chill0r 2014-09-29 14:46:20