Example Using the pass keyword in a function definition: def myfunction(): pass Try it Yourself » Example Using the pass keyword in a class definition: class Person: pass Try it Yourself » ExampleUsing the pass keyword in an if statement:...
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
for loops cannot be empty, but if you for some reason have a for loop with no content, put in the pass statement to avoid getting an error.ExampleGet your own Python Server for x in [0, 1, 2]: pass Try it Yourself »