Computer Science, asked by vishalthakur441010, 7 months ago


. A Python program is written for getting input of 2 numbers and display their sum, but this
program have some errors, correct them and rewrite the code with highlighting the errors:
X=int(input('Enter first Number:')
Y=int(Input("Enter Second number:"))
print("Sum='+sum)
sum = X+y​

Answers

Answered by Dhruv146238
0

Explanation:

Answer:

x=int(input('Enter the First number - '))

y=int(input('Enter the Second number - '))

z=input('Enter the operator - ')

if (z == '+'):

 print(x+y)

elif(z == '-'):

 print(x-y)

elif(z == '*'):

 print(x*y)

elif(z == '/' and y != 0):

 print(x/y)

elif(y == 0):

 print('divide by zero!')

else:

 print('Error')

Explanation:

Answered by palranveer05
0

Answer:

IDK Type this question on Google

Similar questions