aneliabogeva

Building budget

Aug 16th, 2019
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. budget = float(input())
  2. capital = float(input())
  3. number_investors = int(input())
  4.  
  5. counter = 1
  6.  
  7. while counter <= number_investors:
  8. investor_sum = float(input())
  9. print(f"Investor {counter} gave us {investor_sum:.2f}.")
  10. capital = capital + investor_sum
  11. if capital >= budget:
  12. extra_money = capital - budget
  13. print(f"We will manage to build it. Start now! Extra money - {extra_money:.2f}.")
  14. exit(0)
  15. else:
  16. counter += 1
  17.  
  18. extra_money = budget - capital
  19. print(f"Project can not start. We need {extra_money:.2f} more.")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×