Computer Science, asked by bhoomikabhatia, 4 months ago

write a python program that takes sale for four quarters then displays total sales when average sales made​

Answers

Answered by Equestriadash
11

Source code:

q1 = float(input("Enter the sales for quarter 1: "))

q2 = float(input("Enter the sales for qaurter 2: "))

q3 = float(input("Enter the sales for quarter 3: "))

q4 = float(input("Enter the sales for quarter 4: "))

ts = q1 + q2 + q3 + q4

avgs = ts/4

print("Total sales: " ts)

print("Average sales: ", avgs)

The float() data type is most preferable since we're attaining prices, that could come in decimal values. float() is also preferable since we can't be sure that the total value will be fully divisible by 4.

Answered by Anonymous
2

Answer:

Source code:

q1 = float(input("Enter the sales for quarter 1: "))

q2 = float(input("Enter the sales for qaurter 2: "))

q3 = float(input("Enter the sales for quarter 3: "))

q4 = float(input("Enter the sales for quarter 4: "))

ts = q1 + q2 + q3 + q4

avgs = ts/4

print("Total sales: " ts)

print("Average sales: ", avgs)

The float() data type is most preferable since we're attaining prices, that could come in decimal values. float() is also preferable since we can't be sure that the total value will be fully divisible by 4

Similar questions