+ 1

Why “error” prints in last

I don’t know why and how “else” part is executed that is outside of loop ...plz explain 🥲 https://code.sololearn.com/ckIoqzH6CBeG/?ref=app

18th Feb 2021, 1:43 PM
Sarthak
Sarthak - avatar
1 Odpowiedź
+ 1
Abol if the for loop terminates by break statement then else doesn't executes. For example change it to x==5 and else won't execute,
18th Feb 2021, 2:56 PM
Abhay
Abhay - avatar