Computer Science, asked by nidhi1644, 5 months ago

Find the error in the following Python code. Rewrite the code by making corrections.

A=INT(input(enter a number)
Sum=A+10
Output(The sum is ,Sum)

*Pls don’t spam*

Answers

Answered by allysia
17

Answer:

Errors:

\\\tt A= \underline{INT} (inpu t(\underline{enter\  a\ number}  \underline{ )}\\\ttSum=A+10\\\tt\underline{Outpu t} ( \underline {The \ sum\  is} ,\ Sum)

A correct program will go like:

\\\tt A=int(inpu  t( "enter\ a \ number\ " )\\\ttSum=A+10\\\ttprint(\ "The\ sum\ is"  ,Sum)

Answered by jai696
16

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

Corrected code

A = int(input("enter a number: "))

Sum = A + 10

print("The sum is", Sum)

You can also rewrite it as follows

print("The sum is", (A := int(input("enter a number: ")) + 10))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions