Python Example | An Introduction the Difference Between pass And continue

This python example code will show us the difference between pass and continue in python.

Passcontinue
does nothingjumps for next iteration
required when syntactically needed but practically notrequired when want to skip the execution of remaining statement(s) inside the loop for current iteration
can be used as a placeholder for future codecan not be used as a placeholder for future code

Here is an example:

nums = [1, 2, 3, 4, 5]

print("----Using \"pass\"-------")
for n in nums:
    if n == 3:
        pass
    print(n)

print("----Using \"continue\"-------")
for n in nums:
    if n == 3:
        continue
    print(n)