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
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:-
- Initialisation is wrong. Correct one is:- a=10
- Identifier name must no be a keyword. Replace if with other variable names.
- String literal must be enclosed within double quotes.
Answered by
1
Corrected Code:
a = 10
b = 20
sum = a + b
print("Result is -", sum)
Similar questions
Computer Science,
2 months ago
Social Sciences,
6 months ago
Hindi,
6 months ago
English,
11 months ago
Biology,
11 months ago