我是一名python初學者。我試圖運行此代碼:當我召喚main()
我得到這個ValueError
python valueerror:太多值來解壓
def main():
print (" This program computes the average of two exam scores . ")
score1,score2 = input ("Enter two scores separated by a comma:")
average = (score1 + score2)/2.0
print ("The average of the score is : " , average)
:
ValueError: too many values to unpack (expected 2)
什麼是錯的代碼?
@musical_coder:除非你確定OP沒有使用Python 3,否則不要試圖從打印函數中刪除'()'。 – geoffspear