Looping Through a List

A for loop runs the same lines once for each item in a list, enumerate() numbers the items as it goes, sum(), min() and max() total and compare a list's numbers, and sorted() hands back a sorted copy while .sort() sorts the list itself.

By

Updated

Cheat sheet: Looping Through a List
Category
Python
Level
Apprentice
Tags
enumerate(), for-loop, min() and max(), python, sort() (python), sorted(), sum()