Meaning & use

loop over

phrase·Advancedcomputinginformal

Last updated

UK/ˈluːp ˌəʊvə/
US/ˈluːp ˌoʊvɚ/

Meaning

  1. phrasephrasal verbcomputing

    To go through each item in a list or collection one after another in a program, performing the same steps on each.

    Grammar: Takes an object after over: loop over the list.

    Patterns

    • loop over something
    • loop over something and do something

    You can loop over every name in the list and print it.

    The script will loop over all the files in the folder.

    I need to loop over the rows of the table and add up the totals.

Word forms

third person singularloops over
past tenselooped over
past participlelooped over
-ing formlooping over

Common combinations

loop over a list
Loop over a list of numbers and square each one.
loop over the elements
The function will loop over the elements of the array.
loop over each item
Loop over each item and check whether it is empty.
loop over the keys
We loop over the keys of the dictionary to find the match.
loop over all files
The program will loop over all files in the directory.

Synonyms and how they differ

iterate over
Iterate over is the more formal term for the same action, while loop over is the casual spoken version.
traverse
Traverse suggests moving through a structure such as a tree, whereas loop over fits flat lists.
cycle through
Cycle through can mean going round again and again, while loop over usually has an end.

Word family

loop noun
a set of steps that repeats
loop verb
to repeat a sequence of instructions
looping noun
the use of loops in code
iteration noun
one pass through a loop

Commonly confused: loop over or loop in?

loop over vs loop in

To loop someone in means to include them in a conversation or email. It has nothing to do with going through items in code.

Practice

Which sentence uses the phrasal verb correctly in a programming context?

Make it your own

Write a sentence using “loop over”, then check it and compare it with the examples above.

Your sentence stays on this page and is not sent anywhere.

Explore more words