Initially, the variables are assigned these values:
x = 5
y = 10
z = 8
The line x, y, z = z, y, x swaps the values of the variables using tuple packing and unpacking:
Now, x = 8
Now, y = 10
Now, z = 5
The print statement (y - 5) == x calculates y - 5 which is 10 - 5 = 5. Then it checks if the result is equal to the value of x, which is 8. This evaluates to False.
Watch video Python online without registration, duration hours minute second in high quality. This video was added by user Robaidul Islam 12 August 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2 once and liked it people.