My question is pertaining to the Carly’s Clippers project (https://www.codecademy.com/paths/computer-science/tracks/cspath-cs-101/modules/cspath-python-loops/projects/python-carlys-clippers)
Step 12 asks you to create a list comprehension that uses a piece of code that looks like:
I’m just curious, why does the range have to be equal to len(new_prices) - 1? Wouldn’t that make the loop stop just short of the full list? Also, is it correct to say that the purpose of using the range function here is just to tell the program how many times to check if new prices is < 30? If that’s true then it makes even less sense to stop the loop short of the full list because then you’d potentially be missing out on a last piece of data.
In this case, it doesn’t matter, as removing the - 1 doesn’t change anything, but I’m confused why they tell you to do that, and then even the hint doesn’t include it.