Copied! The highlighted line does the magic and swaps the values of previous_value and next_value at the same time. Note that in a programming language that doesn’t aid this sort of assignment, you’d should use A brief variable to make exactly the same effect: Copied! Eventually, comprehensions do the job https://josuemqsoa.blogolenta.com/25228162/do-my-python-homework-fundamentals-explained