kalin_inkov

Lecture2Zad7

Sep 19th, 2020
857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. price_trip = float(input())
  2. puzzles = int(input())
  3. dolls = int(input())
  4. bears = int(input())
  5. minios = int(input())
  6. trucks = int(input())
  7. number_toys = puzzles + dolls + bears + minios + trucks
  8. total_price = puzzles * 2.6 + dolls * 3 + bears * 4.10 + minios * 8.20 + trucks * 2
  9. from math import fabs
  10.  
  11. if number_toys >= 50:
  12.     ostatyk = total_price*0.75 * 0.90
  13.     if ostatyk >= price_trip:
  14.         print(f"Yes! {ostatyk-price_trip:.2f} lv left.")
  15.     else:
  16.         print(f"Not enough money! {fabs(ostatyk-price_trip):.2f} lv needed.")
  17.  
  18. else:
  19.     ostatyk = total_price * 0.90
  20.     if ostatyk >= price_trip:
  21.         print(f"Yes! {ostatyk-price_trip:.2f} lv left.")
  22.     else:
  23.         print(f"Not enough money! {fabs(ostatyk-price_trip):.2f} lv needed.")
  24.  
  25.  
RAW Paste Data