using else with for loops

 for i in ["harish","shiva","robin"]:

    if i=="harish" :
print(i)
break
else:
print("for loop completed properly")

Comments

Popular posts from this blog

property decorator

'is' vs '==' in python

Function caching