# You run a hovercraft factory. Your factory makes ten hovercrafts in a month.# Given the number of customers you got that month, did you make a profit?# It costs you 2,000,000 to build a hovercraft, and you are selling them for# 3,000,000. You also pay 1,000,000 each month for insurance.# TASK:# Determine whether or not you made a profit based on how many of the ten# hovercrafts you were a le to sell that month.# INPUT FORMAT:# An integer that represents the sales that you made that month.# OUTPUT FORMAT# A string that says "Profit', 'Loss', or 'Broke Even'.# SAMPLE INPUT# 7# SAMPLE OUTPUT# Loss# Explanation# If you only had 5 hovercrafts, you spent 21,000,000 to operate but only made# 15,000,000.defmain():hc=int(input("Hovercrafts sold: "))# hcs = int(hc)is_hover(hc)defis_hover(hcs):build=2000000eachhc=3000000ins=1000000a=hcs*eachhcspent=(10*build)+insamtmd="Amount made: "print(f'{amtmd}{a}')ifa==spent:print("Broke Even")elifa>=spent:print("Profits")elifa<=spent:print("Loss")main()
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.