Python recursion returns None

前端 未结 2 1532
野的像风
野的像风 2021-01-29 07:38

This will be really funny... Given following python codes:

def getBinary(binaryInput, kSize, beginBit):
    if int(binaryInput[beginBit + kSize-1])=         


        
2条回答
  •  自闭症患者
    2021-01-29 07:56

    When a function ends without executing a return statement, it returns None. Instead of

    getBinary(binaryInput, kSize, beginBit)
    

    you mean

    return getBinary(binaryInput, kSize, beginBit)
    

提交回复
热议问题