About 14,700,000 results
Open links in new tab
  1. Iterate over a list in Python - GeeksforGeeks

    Jan 2, 2025 · Python provides several ways to iterate over list. The simplest and the most common way to iterate over a list is to use a for loop. This method allows us to access each …

  2. 7 Ways to Loop Through a List in Python - LearnPython.com

    Jul 29, 2022 · Learn several ways to loop through a list in Python, including for loops, while loops, and much more!

  3. Searching for an element in a list with a loop in Python

    Apr 17, 2017 · You could also use list.count to see if any element exists in the list (and how many times it appears in that list).

  4. 5 Best Ways to Search for an Element in a Python List

    Feb 26, 2024 · Iteration through a list using a loop provides flexibility to customize the search, such as finding multiple occurrences or applying complex conditions. This method is manual …

  5. Python - Loop Lists - W3Schools

    You can loop through the list items by using a while loop. Use the len() function to determine the length of the list, then start at 0 and loop your way through the list items by referring to their …

  6. python - How to find an item in a list (without using "in" method ...

    Jun 18, 2016 · I am trying to find an item in a list without using "in" method. I tried to do it using loop. The code executed successfully, but giving collective result for both (item found as well …

  7. 13 Ways to Loop Through a List in Python [Examples Included]

    Jun 21, 2021 · For Loop in Python with List. Using a for loop in combination with the range() function is the most common (and easiest) way to loop through a list in Python. I’ve gone …

  8. python - Search in lists of lists by given index - Stack Overflow

    Now, is there a way to see if I have a pair in which a string is present in just the second position? I can do this: if list[i][1]==search: found=1. But is there a (better) way without the for loop? I …

  9. How to Use a For Loop to Iterate over a List - Python Tutorial

    To iterate over a list, you use the for loop statement as follows: # process the item Code language: Python (python) In this syntax, the for loop statement assigns an individual element …

  10. Python - Loop Through a List - Includehelp.com

    May 1, 2025 · Looping Through a List Using while Loop. You can also loop through a list using a while loop. This gives more control over the iteration but requires manual management of the …

Refresh