Computer Science, asked by Anonymous, 10 months ago

write a python program to make a simple calculator.........


don't spam

❣❣❣❣Aarvi​

Answers

Answered by Anonymous
48

\huge{\star}{\underline{\boxed{\red{\sf{Answer :}}}}}{\star}

______________[Code]_____________

# Calculator Program

x = int(input("Enter First number : "))

y = int(input("Enter Second number : "))

Sum = x + y

Difference = x - y

Product = x * y

Division = x/y

print("Sum of the numbers is : " ,Sum)

print("Difference of the numbers is : " ,Difference)

print("Product of numbers is : " ,Product)

print("Division of the numbers is : " ,Division)

________________[End]_____________

Answered by Equestriadash
7

The following codes will have to be typed in script mode, saved and then executed.

CODE:

x = int(input("Enter a value:"))

y = int(input("Enter a second value:"))

print("Below are the numbers signifying each operation. Choose what operation you'd like to perform.")

print("Addition - 1", "Subtraction - 2", "Multiplication - 3", "Division - 4", sep="\n")

op = int(input("Enter the operation you'd like to perform:"))

if op == 1:

   print("You've chosen addition. The resultant value is", x + y)

elif op == 2:

   print("You've chosen subtraction. The resultant value is", x - y)

elif op ==  3:

   print("You've chosen multiplication. The resultant value is", x*y)

elif op == 4:

   print("You've chosen division. The resultant value is", x/y)

OUTPUT:

Attachments:
Similar questions