PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 28, 2022

[FIXED] how can you explain me this?

 October 28, 2022     if-statement, is-empty, loops, range, while-loop     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing