line iterators also watch for the sidebar "why you will careshell commands and moreon page in this it applies these same file tools to the os popen command-line launcher to read program output there' more on reading files in tooas we'll see theretext and binary files have slightly different semantics in loop coding techniques the for loop we just studied subsumes most counter-style loops it' generally simpler to code and often quicker to run than whileso it' the first tool you should reach for whenever you need to step through sequence or other iterable in factas general ruleyou should resist the temptation to count things in python--its iteration tools automate much of the work you do to loop over collections in lower-level languages like stillthere are situations where you will need to iterate in more specialized ways for examplewhat if you need to visit every second or third item in listor change the list along the wayhow about traversing more than one sequence in parallelin the same for loopwhat if you need indexes tooyou can always code such unique iterations with while loop and manual indexingbut python provides set of built-ins that allow you to specialize the iteration in forthe built-in range function (available since python xproduces series of successively higher integerswhich can be used as indexes in for the built-in zip function (available since python returns series of parallelitem tupleswhich can be used to traverse multiple sequences in for the built-in enumerate function (available since python generates both the values and indexes of items in an iterableso we don' need to count manually the built-in map function (available since python can have similar effect to zip in python xthough this role is removed in because for loops may run quicker than while-based counter loopsthoughit' to your advantage to use tools like these that allow you to use for whenever possible let' look at each of these built-ins in turnin the context of common use cases as we'll seetheir usage may differ slightly between and xand some of their applications are more valid than others counter loopsrange our first loop-related functionrangeis really general tool that can be used in variety of contexts we met it briefly in although it' used most often to generate indexes in foryou can use it anywhere you need series of integers in while and for loops