Ashraf Miah
Jan 27, 2023

--

"else" is not required to terminate a for or while loop. It can be useful in some scenarios if you need to run something after finishing a loop. Usually you don't have print statements saying loop finished.

--

--

Ashraf Miah

CTO, Data Scientist & Chartered Engineer (MEng CEng EUR ING MRAeS) with over 20 years experience in the Aerospace, Rail & Energy Industry.