Clarification for If & While Loops


Functionality-wise, what's the difference between an "if" loop and a "while" loop?


if is not a loop.

if allows for conditional execution of code fragments. If the condition is met the block of code will be executed only once.

while allows to execute fragment of code again and again as long as the condition evaluates to true.


Thank you! What would you define "if" as, a statement?


You're very welcome! :slight_smile:

Statement, construct seems accurate. Loop implies that code will be executed few times.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.