As it says in the header, FOR LOOP is used when we want to execute block of code statements again and again until a condition is met, we can use For loops. To be very specific, to iterate any collections, like a list, tuples, etc. we can use For loops. Example: Let’s understand FOR LoopContinue reading “For Loop”
Tag Archives: loops
While Loop
While Loops can be used if we need to execute the same set of statements again and again until a condition is met. For example, if we need to print a statement 5 times, we can use while loop. Let’s try to understand with an example: Example: Let’s try to print the value of variableContinue reading “While Loop”