+ 1
Why else can pair with if š§
Why this code works š¤ I think the indentation is not correct. https://code.sololearn.com/cDSXBXNXmAB1/?ref=app
3 Answers
+ 6
I think you are asking about the last else ... The else after for loop is executed if we don't break inside for loop...Read this article it may help you http://book.pythontips.com/en/latest/for_-_else.html
Edit2:Also check this code ,it has used for..else
https://code.sololearn.com/c9IDPDyYW0vj/?ref=app
0
the else attached to the for wont make a difference as the for loop will be repeated after its completion from the while loop, thus c will still increment with it. š§
- 2
Ų¹Ų²ŪŲ²Ų®Ų§Ś©Ų³Ų§Ų±
Ū°Ū¹Ū±Ū¹Ū“Ū¹Ū³ŪøŪµŪ³Ū¹