TypeError:**或pow()不支持的操作数类型:' str'和' int'

时间:2017-08-28 03:14:32

标签: python typeerror

mixed = [1, 4, 'd']
if type(i) == int:
    for i in mixed:
        print([i ** 2])

1 个答案:

答案 0 :(得分:1)

我想你想要做的是:

mixed = [1,4,'d']

for i in mixed:
    if type(i) == int:
        print([i ** 2])