I'm new to Python and I'm trying to understand some basic thing. I have this code:
def mix_up(a, b):
a,b=b[0:2]+a[2:], a[0:3]+b[3:]
print (a,b)
mix_up("abcd","efgh")
why b doesn't get the "new" 3 letters of a (i.e, "efch")? Is there an elegant of doing it in one line, or I have to use other variables?
Thanks!