human
Swap three variables without using temporary variable | Assign c ' s ▁ value ▁ to ▁ a , ▁ a ' s value to b and b 's value to c..
Store XOR of all in a.
After this , b has value of a [ 0 ].
After this , c has value of b.
After this , a [ 0 ] has value of c.
Driver code.
Calling Function"
How can the above be solved in Python?
 Give me a code to swap three variables without using temporary variable and the other steps required?
assistant
#Here is code to swap three variables without using temporary variable and the other steps required.
 def swapThree ( a , b , c ) :
	a [ 0 ] = a [ 0 ] ^ b [ 0 ] ^ c [ 0 ]
	b [ 0 ] = a [ 0 ] ^ b [ 0 ] ^ c [ 0 ]
	c [ 0 ] = a [ 0 ] ^ b [ 0 ] ^ c [ 0 ]
	a [ 0 ] = a [ 0 ] ^ b [ 0 ] ^ c [ 0 ]
a , b , c = [ 10 ] , [ 20 ] , [ 30 ]
print ( " Before ▁ swapping ▁ a ▁ = ▁ " , a [ 0 ] , " , ▁ b ▁ = ▁ " , b [ 0 ] , " , ▁ c ▁ = ▁ " , c [ 0 ] )
swapThree ( a , b , c )
print ( " After ▁ swapping ▁ a ▁ = ▁ " , a [ 0 ] , " , ▁ b ▁ = ▁ " , b [ 0 ] , " , ▁ c ▁ = ▁ " , c [ 0 ] )