Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math;
- moneyToSave = float(input())
- numOfFantasyBooks = int(input())
- numOfHorrorBooks = int(input())
- numOfRomanceBooks = int(input())
- income = numOfFantasyBooks * 14.90 + numOfHorrorBooks * 9.80 + numOfRomanceBooks * 4.30;
- income -= income * 0.20;
- moneyForSellers = 0;
- if (income >= moneyToSave):
- moneyForSellers = math.floor((income - moneyToSave)*0.1);
- income -= moneyForSellers;
- print(f"{income:.2f} leva donated.");
- print(f"Sellers will receive {moneyForSellers} leva.");
- else:
- diff = moneyToSave - income;
- print(f"{diff:.2f} money needed.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement