标签: python typeerror
mixed = [1, 4, 'd'] if type(i) == int: for i in mixed: print([i ** 2])
答案 0 :(得分:1)
我想你想要做的是:
mixed = [1,4,'d'] for i in mixed: if type(i) == int: print([i ** 2])