© 1999-2048 dssz.net 粤ICP备11031372号
[其它] 解决complex转int的问题
说明:解决complex转int的问题 代码 错误 int(666j) Traceback (most recent call last): File “”, line 1, in int(999j) TypeError: can’t convert complex to int 正确 def complextoint(cp): cp = list(str(cp)) #从complex转str再转list cp.remove(j) #去掉尾部的j j = "" #创造空字符串变量j for<weixin_38711149> 上传 | 大小:21kb