Assembled by Adam Whaley, Original Text: How to Think like a Computer Scientist., Original Text: Problem Solving with Algorithms and Data Structures, Original Text: Python for Everybody - Interactive
Functions can return tuples as return values. This is very useful β we often want to know some batsmanβs highest and lowest score, or we want to find the mean and the standard deviation, or we want to know the year, the month, and the day, or if weβre doing some ecological modeling we may want to know the number of rabbits and the number of wolves on an island at a given time. In each case, a function (which can only return a single value), can create a single tuple holding multiple elements.