Need help with python 2 problem:
Given two strings a and b, set the value in a to a + b and the value in b to b + a using only one assignment instruction. Then print the value in a followed by the value in b.
Code is:
a=’abc’
b=’xyz’
a = a + b
b = b + “abc”
print (a)
print (b)
Return is:
For a = “abc”, b = “xyz”, expected output to be
abcxyz
xyzabc
Your code printed
abcxyz
xyzabcxyz
Any help is appreciated. Thanks.