Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- age_Lilly = int(input())
- price_washing_machine = float(input())
- price_toy = int(input())
- toys_count = 0
- money_sum = 0
- total_sum = 0
- for years in range(1, age_Lilly + 1):
- if years % 2 == 1:
- toys_count += 1
- else:
- money_sum += years * 5 - 1
- total_sum = toys_count * price_toy + money_sum
- differance = abs(total_sum - price_washing_machine)
- if total_sum >= price_washing_machine:
- print(f"Yes! {differance:.2f}")
- else:
- print(f"No! {differance:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment