If loop within function returns value error when input is an array

前端 未结 0 821
庸人自扰
庸人自扰 2021-01-28 17:38

I have a function f(x) as follows:

def f(x):
    if x> 3:
       k = x
    else:
       k = 2*x
    return k

f(2)
f([2,3])

If I

相关标签:
回答
  • 消灭零回复
提交回复
热议问题