Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Python program that reads in two integers and displays the following: a.

ID: 3666661 • Letter: W

Question

Write a Python program that reads in two integers and displays the following:

a. the sum of the two numbers

b. the product of the numbers

c. the average of the two numbers

d. the minimum of the two numbers

e. the maximum of the two numbers

A sample run is shown below:

Enter first integer: 23

Enter second integer: 42

The sum of the two numbers is: 65

The product of the two numbers is: 966

The average of the two numbers is: 32.5

The minimum of the two numbers is: 23

The maximum of the two numbers is: 42

Explanation / Answer

#!/usr/bin/python
num1=input( 'enter first number')
num2=input( 'enter second number')
sum=num1+num2
product=num1*num2
average=sum/2
print 'sum of given numbers ',format(sum)
print 'product of given numbers ',format(product)
print 'averageof given numbers ',format(average)
min= num1 if (num1<num2) else num2
max= num1 if (num1>num2) else num2
print 'minimum of given numbers ',format(min)
print 'maximum of given numbers ',format(max)

Here is the code for you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote