rangga_hrdme

KINDS OF FUNCTION 1

Apr 26th, 2021
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. # Procedure
  2. def menu():
  3.     HayUni()
  4.     interest(1_000_000, 5, 7)
  5.  
  6. # Procedure
  7. def HayUni():
  8.     print("Haii... Universe")
  9.  
  10. # Function (PARAMETER)
  11. def interest(money, percent, month):
  12.     result = money * (percent/100) * (month/12)
  13.     results = int(result)
  14.     print("Money: ", money, " Percent: ", percent, " Month: ", month, "INTEREST; ", results, " DECIMAL: ", result)
  15.  
  16. menu()
  17.  
  18. # FUNCTION 3:
  19. # 1. Function without parameter (Procedure), example: main()
  20. # 2. Function with parameter, example: interest(parameter). interest() is constructor
  21. # 3. Function with return (method)
  22. # 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