Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buying_price = float(input("Enter the buying price.\n"))
- selling_price = float(input("Enter the selling price\n"))
- #Formula for calculating profit percent is (sellingprice - costprice)/costprice * 100.
- #For loss, the percent remains same but in negative.
- percent_change = (selling_price - buying_price)/buying_price * 100
- if percent_change <10 and percent_change > -10:
- print("Eh, just another normal day in trading.")
- if percent_change >= 10:
- print("Congratulations! You are rich.")
- if percent_change <= -10:
- print("Oh no! You are broke.")
Add Comment
Please, Sign In to add comment