undefined

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content
Previous: Control Flow Next: Functions - Part I

The Empty Statement

The empty statement, pass, is another example of Python syntax that one might find confusing at first glance:

budget = 13
costs = [5, 3, 2]
for i, cost in enumerate(costs):
pass # TODO: put off until tomorrow
else:
print('Remaining budget:', budget)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content