Python : creating dynamic functions

前端 未结 4 1710
失恋的感觉
失恋的感觉 2020-12-28 21:21

I have issue where i want to create Dynamic function which will do some calculation based to values retrieved from database, i am clear with my internal calculation but ques

4条回答
  •  爱一瞬间的悲伤
    2020-12-28 21:45

    This answer may be assuming your intentions are too simplistic, but it appears as if you want to set a value for particular function calls.

    Would you consider something like the following?

    def setEffort(n):
        effort = str(n)+'d' 
    

提交回复
热议问题