+ 5
What is the use of "pass" in python?
3 Answers
+ 9
I use it as a placeholder when designing a class or defining a function. Just so the code would be runnable. Then I fill in the "blank" :)
+ 8
In other languages you've learned, you get the same effect with a ; without a statement. It is a null statement. Allowing this code to find the first 5 in the array.
while x[i++] != 5:
pass
+ 4
pass Is used as a null object, when you still do not have the structure of your function, put it inside and you won't get any error.