Recently, I only have to write such boring exercises , Don't say nonsense , Questions as follows :
The problem is simple , No comments required
lockPrice = 45
stockPrice = 30
barrelPrice = 25
lockNum = int(input(" Number of guns :"))
stockNum = int(input(" Number of butts :"))
barrelNUm = int(input(" Number of barrels :"))
if lockNum < 1 or stockNum < 1 or barrelNUm < 1:
exit(" Not up to standard , Not calculated !")
if lockNum > 70 or stockNum > 80 or barrelNUm > 90:
exit(" Misrepresentation of sales quantity , Not calculated !")
allCash = lockNum * lockPrice + stockNum * stockPrice + barrelNUm * barrelPrice
if allCash > 1800:
profit = (allCash - 1800) * 0.2 + 800 * 0.15 + 1000 * 0.1
elif allCash > 1000:
profit = (allCash - 1000) * 0.15 + 1000 * 0.1
else:
profit = allCash * 0.1
print("=" * 30)
print(" Number of guns sold :%d" % lockNum)
print(" Number of butts sold :%d" % stockNum)
print(" Number of barrels sold :%d" % barrelNUm)
print(" Total sales :%d" % allCash)
print(" The total profit is :%d" % profit)
print("=" * 30)