Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import ceil
- budget = float(input())
- students = int(input())
- flour_price = float(input())
- egg_price = float(input())
- apron_price = float(input())
- total_flour = flour_price * students - students // 5 * flour_price
- total_eggs = 10 * egg_price * students
- total_aprons = ceil(students* 1.2) * apron_price
- total_sets = total_flour + total_eggs + total_aprons
- if budget >= total_sets:
- print(f'Items purchased for {total_sets:.2f}$.')
- else:
- print(f'{total_sets - budget:.2f}$ more needed.')
Advertisement
Add Comment
Please, Sign In to add comment