Ask Question
6 September, 08:34

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)

+5
Answers (1)
  1. 6 September, 09:34
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers