Q:

Sum/ average / product in python

I am trying to write a program which asks an input of two numbers and  then prints the sum, product and average by running it. I wrote a program but it asks an input for 2 numbers everytime i need a sum or average or product. How can I get all 3 at once, just making two inputs once.
sum = int(input("Please enter the first Value: ")) + \
      int(input("Please enter another number: "))
print("sum = {}".format(sum))

product = int(input("Please enter the first Value: ")) * \
          int(input("Please enter another number: "))
print ("product = {}".format(product))

A:

Use variables to store the input:
first_number = int(input("Please enter the first Value: "))
second_number = int(input("Please enter another number: "))

sum = first_number + second_number
product = first_number * second_number
average = (first_number + second_number) / 2

print('Sum is {}'.format(sum))
print('product is {}'.format(product))
print('average is {}'.format(average))

