Python program that inputs three different integers from the keyboard, and then prints the sum, the average, the product, the smallest, and the largest of these numbers.

Here is the code for a python program that inputs three different integers from the keyboard, and then prints the sum, the average, the product, the smallest, and the largest of these numbers.

# Python program that inputs three different integers from the keyboard, and then prints the sum, the average, the product, the smallest, and the largest of these numbers.

firstNumber = int(input("Enter first number: "))
secondNumber = int(input("Enter second number: "))
thirdNumber = int(input("Enter third number: "))

print("Sum =", firstNumber + secondNumber + thirdNumber)
print("Average =", (firstNumber + secondNumber + thirdNumber) / 3)
print("Product =", firstNumber * secondNumber * thirdNumber)

max = firstNumber
if secondNumber > firstNumber:
    max = secondNumber
if thirdNumber > secondNumber:
    max = thirdNumber
print("Maximum =", max)

min = firstNumber
if secondNumber < firstNumber:
    min = secondNumber
if thirdNumber < secondNumber:
    min = thirdNumber
print("Minimum =", min)

# This code is contributed by Ahmad Shafiq
callout-flag

Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

Author

This Post Has 2 Comments

  1. Ayesha

    Thank you

Leave a Reply

girl-carrying-document

More Articles.

girl-carrying-document

More Articles.