Friday, October 28, 2022

[FIXED] how can you explain me this?

Issue

It gives me an empty list if I didnt put x=list(range(a, b, -1)) again in the loop while, why ?

Image

Thanks.


Solution

If a < b then the range will be created as an empty range. The range won't magically update when a and b gain new values because the values have already been assigned to the range. That's why you have to recreate the range with the updated values of a and b.



Answered By - Aplet123
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.