113k views
5 votes
The East Coast sales division of a company generates 62 percent of total sales. Based on that percentage, write a Python program that will predict how much the East Coast division will generate if the company has $4.6 million in sales this year. You should not perform the calculation by hand and put the result into the program; instead, your program would write a formula to do the computation and display the result.

1 Answer

6 votes

Answer:

def prediction(sales):

print(0.62 * sales)

prediction(4600000)

Step-by-step explanation:

Code written in python :

We could write it out has a function :

The code is written has a function ;

'def' starts the function which is named prediction. The function takes in a single argument which is the amount of sales made. Since the percentage of sales generated is a constant pegged at 62%. The expression print( 0.62 * sales) outputs the amount generated by east coast. The function call; prediction(4600000) prints the amount generated if a sales of $4600000 is made.

User Jari Laamanen
by
5.3k points