Examples of pass statement in Python Programming
All Contributions
pass statement can be used with conditional statements :
a = 10
b = 20
if(a<b):
pass
else:
print("b<a")
pass statement can be used in for loop when user doesn’t know what to code inside the loop :
n = 10
for i in range(n):
# pass can be used as placeholder
# when code is to added later
pass
Pass statement :
'''pass is just a placeholder for
functionality to be added later.'''
sequence = {'p', 'a', 's', 's'}
for val in sequence:
pass
total contributions (6)
pass statement get executed when the condition is true :