E,F,A,B gives a tuple (5,6,1,2) , which has no relation to the original variables and is in no way connected with them.
foo = E,F,A,B print(foo) # => (5, 6, 1, 2) E = -777 print(foo) # всё ещё => (5, 6, 1, 2)
The syntax A,B,C,D = is unpacking (in this case a tuple) - sequentially assigns variables from a list, tuple, or any other iterated object (you can put = range(4) , for example) after the equal sign. And the tuple, which stands on the right, no longer has anything to do with the original variables. That is, it turns out something like:
A,B,C,D = (5,6,1,2)
In the second case, the code is simply executed sequentially as it is and changes the variables, I hope it does not need explanations)
More examples:
a, b, c = [1, 2, 3] # a = 1, b = 2, c = 3 a, b, c = range(3) # a = 0, b = 1, c = 2 a, b, *l, c = range(5) # a = 0, b = 1, l = [2, 3], c = 4
An example with its generator:
def gen(): yield int(input('Первое число: ')) yield int(input('Второе число: ')) a, b = gen() print(a, b)
Will give:
Первое число: 3 Второе число: 4 3 4