Question: Write a Python program that first prompts the user to enter two integer numbers , which will be assigned to variable x and variable y

Write a Python program that first prompts the user to enter two integer numbers, which will be assigned to variable x and variable y. Then, perform the following Math operations to variables x and y:

  • (1) addition
  • (2) subtraction
  • (3) multiplication
  • (4) floating-point division (x as the dividend, y as the divisor)
  • (5) integer division (x as the dividend, y as the divisor)
  • (6) remainder (x as the dividend, y as the divisor)
  • (7) exponentiation (x as the base, y as the exponent)

Finally, print out the calculation results.

Write a Python program that first prompts the user to enter two

Enter the 1st integer: 7 Enter the 2nd integer: 2 [addition] total: 9 [subtraction] difference: 5 [multiplication] product: 14 [floating-point division] quotient: 3.5 [integer division] integer quotient: 3 [remainder] remainder: 1 [exponentiation ] power: 49

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!