top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Profit and Loss Calculator

Writer: ekow.a.indomeekow.a.indome

As business firm, you would always want to know how well you are performing and if you are making more than expected or less than what you invest in your business. This calculator is a simple calculator that calculates either profit or loss based on monthly sales. Here is how it works:

The program first takes the enterprise's name. Then a selling price in the form of monetary value(i.e. .00) is entered, followed by the cost price of the product.

print("A program to analyze profit and loss")
name = input("Enter the name of the enterprise: ")
selling_price = float(input("Enter the selling price: "))
cost_price = float(input("Enter the cost price: "))

All now that it's left is for the program to use decision statements to find our if you are making profit or making losses. This helps reduce excess calculations .


if (selling_price > cost_price):
    profit = selling_price - cost_price
    profit_percent = (profit / cost_price) * 100
    txt = "You had a profit of {:.2f} at a profit percent of {:.2f}"
    print(txt.format(profit, profit_percent))
else:
    loss = cost_price - selling_price
    loss_percent = (loss / cost_price) * 100
    text = "You had a loss of {:.2f} at a loss percent of {:.2f}"
    print(text.format(loss, loss_percent))





 
 

Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page