Tag: loop

  • What is for loop in Python give example?

    The for loop in Python is one of the main looping constructs. Usually we use the for loop when we want to iterate over the sequence.  This sequence could be a collection, such as tuple, list, or even a string. As a result of iteration, the placeholder variable takes every item as we iterate over…

  • Python while loop

    In our previous section we have seen examples of if-else. In this section, we will take a look at Python while loop. The common question that comes to our mind is which one is faster? For or while loop?  In the Java section, we have tried to find out the answer. You may have a…