如何在 python 脚本中定义和执行函数?

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")

我知道如何定义,但我不知道如何执行该功能。 我对编码很陌生...... 寻求帮助

谢谢。

试试这个

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))

直播: https://repl.it/@RKVKanyan/RoyalMediumorchidSale