Why does python use ‘else’ after for and while loops?
It’s a strange construct even to seasoned Python coders. When used in conjunction with for-loops it basically means “find some item in the iterable, else if none was found do …”. As in: But anytime you see this construct, a better alternative is to either encapsulate the search in a function: Or use a list … Read more