在python中,
apply (math.sqrt ,(4))
(或其他单参数函数)返回
TypeError: apply() arg 2 expected sequence, found int
知道为什么吗?谢谢
发布于 2017-06-01 01:55:25
从docs
the args argument must be a sequence.
(4)不是序列,它只是4。要创建长度为1的元组,请使用(4,)。
(4)
4
(4,)
https://stackoverflow.com/questions/44291563
相似问题