why sir has put underscore in this
Sir please explain this
Hello @kumarpratikkant,
In first you have not specified anything which needs to be iterated. So, it raises the error.
In the second you are using _ (underscore) for iterating now this _ is a unique character in python which helps users to write Python code productively.
Single standalone underscore _ is a valid character for a Python identifier, so it can be used as a variable name
Like for example for ignoring values.
a,_,b=3,4,5
print(a,b)
will output 35
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.