Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- age = int(input())
- washer = float(input())
- toy_price = int(input())
- toys = 0
- money = 0
- total = 0
- even_years = 0
- for i in range(1, age + 1):
- if i % 2 == 0:
- money += 10 * (i / 2)
- even_years += 1
- else:
- toys += 1
- total = (money - even_years) + toys * toy_price
- if total >= washer:
- print(f"Yes! {(total - washer):.2f}")
- else:
- print(f"No! {abs(total - washer):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement