Ask Question
6 January, 08:06

The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? num1=10 num2 = 20 num3="30" sum = num1+num2+num3 print (num1) print (num2) print (num3) print (sum)

+4
Answers (1)
  1. 6 January, 08:14
    0
    num1=10 num2 = 20 num3="30" sum = num1+num2+num3 print (num1) print (num2) print (num3) print (sum)

    The error is at line 3. The variable num3 has been assigned a string value with use of the quotes.

    To fix the error, take away the quotes from the number 30, since the arithemetic operation cannot be carried out on the string in python program language.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? num1=10 num2 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers