Advertisement
rangga_hrdme

KINDS OF FUNCTION 2

Apr 26th, 2021
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. # FUNCTION (PARAMETER)
  2. def StraightLine(Asset, Period, Start, End, Estimation):
  3.     if Asset > 0 and Period > 0 and Start > 0 and End > 0:
  4.         depreciation = float((Asset - Estimation) / Period)
  5.         print("\n", " Depreciation/ Year : ", int(depreciation))
  6.         print("\n |Year|   Amount   - Accummulation =   Resid   | \n")
  7.     else:
  8.         print(" Minimal Integer: 1")
  9.  
  10.     for x in range(Start, (End + 1)):
  11.         accummulation = float(x/Period) * (Asset - Estimation)
  12.         Resid = Asset - accummulation
  13.         message = '  %d   %.2f - %.2f = %.2f' % (x, Asset, accummulation, Resid)
  14.         print(message)
  15.  
  16.  
  17. print("Depreciation : Straight Line Method")
  18. Asset       = float(input("Cost of Bought: "))
  19. print("Period of Depreciation(Year): ")
  20. Period      = int(input("Period (Integer): "))
  21. Start       = int(input("Begin of Year (Integer): "))
  22. End         = int(input("End of Year (Integer): "))
  23. Estimation  = float(input("Residual value(Float): "))
  24.  
  25. StraightLine(Asset, Period, Start, End, Estimation)
  26.  
  27. # Depreciation: Straight Line
  28. # FUNCTION WITH PARAMETER
  29. # Pray 4 Uyghur: https://bylinetimes.com/2020/08/24/death-is-everywhere-millions-more-uyghurs-missing/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement