Search code examples
python-3.7blender

How to define and execute a function in python script?


def calculation_of_salary(hours_worked,pay_per_hour):

salary = hours_worked*pay_per_hour
return salary

name = "kamil"

hw = 6

pph = 10

print("calculation_of_salary")

I know how to define but I don't know how to execute the function. I'm fairly new to coding... Looking for assistance

Thank you.


Solution

  • try this

    def calculation_of_salary(hours_worked,pay_per_hour):
      salary = hours_worked*pay_per_hour
      return salary
    
    name = "kamil"
    
    hw = 6
    
    pph = 10
    
    print(calculation_of_salary(hw,pph))
    

    live : https://repl.it/@RKVKanyan/RoyalMediumorchidSale