© Sanjib Sinha 2017

Sanjib Sinha, Beginning Ethical Hacking with Python, 10.1007/978-1-4842-2541-7_11

11. Loops

Sanjib Sinha

(1)Howrah, West Bengal, India

“While loop” is the simplest form of loop in Python. But you need to understand it properly. Otherwise it can end up eating up your memory running the infinity loop. Usually most of the jobs are done by “for loop”. But in some special cases, you need to use “while loop”. A basic understanding is important.

While Loops

In plain English we often say, “While it is true it keeps on running. While it is not true it stops.” Logically, the same thing happens here. While a statement is true, the process is going on. You need a mechanism to stop that process. That is important. Otherwise that statement ...

Get Beginning Ethical Hacking with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.