我在 python 中使用函数和切换器有一个问题:我有这个生产成本函数:
def fcostoproduccion (X,periodo):
if X > 0:
    switcher = {
            1:  200 + 15 * X,
            2:  100 + 20 * X,
            3:  100 + 4 * (X ** (1 / 2)),
            4:  100 + 3 * X,
            5:  150 + 6 * X,
            6:  200 + 12 * (X ** (1 / 2)),
            7:  200 + 15 * X,
            8:  100 + 10 * X,
            9:  100 + 6 * (X ** (1 / 2)),
            10: 200 + 5 * (X ** (1 / 2)),
            11: 100 + 10 * X,
            12: 150 + 6 * X
            }
return
最后我试图寻找价值:
  for l in range(j+1, k+1):
    Ordenar = O[l] 
    Produccion = fcostoproduccion(Demanda, l)
我知道我犯了一个错误,但不知道如何解决它。提前致谢。