Why isn't the control moving to else in
def test(a=None):
b = 'arghya'
c = 'deep'
for each_con in content:
if a is not None:
if b == c:
print(a)
else:
print(b)
though it is working fine for elif, i.e.
def test(a=None):
b = 'arghya'
c = 'deep'
for each_con in content:
if a is not None:
if b == c:
print(a)
elif a is None:
print(b)
Aucun commentaire:
Enregistrer un commentaire