您好 我想问下num = operator.index(num) TypeError: 'float' object cannot be interpreted as an integer这个错误怎么解决
num = operator.index(num)你的num是float型的index函数接收的参数是int,需要转换一下,如下:num = operator.index(int(num))