Kodewick
Start learning →
Basic←→0 / 100

Low and high

#073BasicFunctionsLists4 min

A week of temperatures is in a list. Write low_and_high(temps) to return two numbers at once, the lowest and the highest, as return low, high. The list has at least one number.

Examples
low_and_high([18, 22, 15, 25, 20])→(15, 25)
low_and_high([-3, 2, 0])→(-3, 2)
main.py
def low_and_high(temps):
    # your code here: find the lowest and highest
    low = 0
    high = 0
    return low, high
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.