Ask Question
15 May, 14:11

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. 15 May, 17:06
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers