Else with For Loop in Python

Else is executed only if For loop completes successfully.

for i in range(5):
    print(i)
    # if i==3:
    #     break
else:
    print("No answer")
    

Comments

Popular posts from this blog

Using insertAdjacentHTML instead of innerHTML to avoid XSS attacks

Loading Windows in CLI mode

Various Types of Computer Architectures