Can you help me with this?


a=int(input ("escribe un numero:"))

n=int(input("escribe un numero entero:"))
def invierte_bit(numero,n):
    return result
print (invierte_bit(numero,n))

The problem is that when I try to run this, the program tells me
"Traceback (most recent call last):
File "C:/Python34/", line 10, in
print (invierte_bit(numero,n))
File "C:/Python34/", line 8, in invierte_bit
TypeError: unsupported operand type(s) for ^: 'str' and 'int'"

I donĀ“t Know how to solve it


This is not part of an exercise? It looks like python3, ran on windows. Take a look at this 3 lines of code:

a=int(input ("escribe un numero:"))

(the first two lines are yours, i added the third), i don't know why you call bin(), and i am not sure what it does, but it casts your integer to string, which is something you don't want to have


Thank you for answering me
I want to do this (see the picture) but introducing the numbers from the keyboard with the order "input".
I am studing python here and I like it a lot (I wish the course never ended) but really I need to study python 3 and I usually repeat the exercises with the new version; sometimes there are some differences


error and problem resolved?