Why are we not initializing “no” before using it in the for loop, can you please explain how this works.
numbers=[no for no in l]
Why are we not initializing "no"
Hey Harjot,
In python, we don’t require to declare or initialize the variable before using it.
We can directly make any variable anywhere we want and use them.
numbers=[no for no in l]
In this example, no is treated as a local variable.
I hope this clears your doubt.
Thanks