Petiasla

Untitled

Dec 22nd, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. ages_lilly = int(input())
  2. price_washingmashine = float(input())
  3. one_toys_price = int(input())
  4.  
  5. money_for_presenet_lily = 0 #парите за всеки Ч РД
  6. present_Lily_toys = 0
  7. total_money = 0
  8.  
  9. for currenet_years in range (1, ages_lilly + 1):
  10. if currenet_years % 2 != 0:
  11. present_Lily_toys += 1
  12.  
  13. else:
  14. money_for_presenet_lily += 10
  15. #brother_help -= 1
  16. total_money += money_for_presenet_lily - 1
  17.  
  18. #sum_sold_toys = present_Lily_toys * one_toys_price
  19. #Savings_lily = money_for_presenet_lily + sum_sold_toys
  20. total_money += present_Lily_toys * one_toys_price
  21. #print(sum_sold_toys)
  22. #print(Savings_lily)
  23. diff = abs(total_money - price_washingmashine)
  24. if total_money >= price_washingmashine:
  25. print(f"Yes! {diff:.2f}")
  26. else:
  27. print(f"No! {diff:.2f}")
  28.  
Advertisement
Add Comment
Please, Sign In to add comment