TypeError: unsupported operand type(s) for ** or pow(): ‘str’ and ‘int’

I guess that what you want to do is:

mixed = [1,4,'d']

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

Leave a Comment