Computer Science, asked by s223511byogesh01430, 6 months ago

Q.7. Rewrite the following code after removing errors:
message
10=a
b=20
if=a+b
PRINT(Result is trs, if)​

Answers

Answered by anindyaadhikari13
2

Question:-

➡ Rewrite the following code after removing the errors.

Solution:-

Given code,

10=a

b=20

if =a+b

PRINT(Result is trs, if)

After correction, the code will be,

a=10

v=20

i=a+b

print("Result is: ",i)

Correction corrected:-

  1. Initialisation is wrong. Correct one is:- a=10
  2. Identifier name must no be a keyword. Replace if with other variable names.
  3. String literal must be enclosed within double quotes.
Answered by Oreki
1

Corrected Code:

a = 10

b = 20

sum = a + b

print("Result is -", sum)

Similar questions