Advertisement
BbJLeB

Untitled

Apr 22nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import math
  2.  
  3. distance = int(input())
  4. fuel_consumption = int(input())
  5. price_fuel = float(input())
  6. win_money = int(input())
  7.  
  8. fuel_consumption1= distance *(fuel_consumption/100)
  9. cost_fuel = fuel_consumption1 * price_fuel
  10.  
  11. need_money = win_money/5
  12.  
  13. money = win_money - cost_fuel
  14.  
  15. if cost_fuel <= win_money:
  16.     print (f"You can go home. {money:.2f} money left.")
  17. else:
  18.     print(f"Sorry, you cannot go home. Each will receive {need_money:.2f} money.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement