Min and Max Pair
beginnerUp next
Dictionaries
Store data as key-value pairs and look things up by name instead of by position.
Next lessonUp next
Store data as key-value pairs and look things up by name instead of by position.
Next lessonOutput will appear here...
The starter code reads a line of integers into a list. Put the smallest and largest values into a tuple, unpack that tuple into low and high, and print them in exactly this format:
Smallest: 2, Largest: 9
That is the output for the input 4 9 2 7. If the list has only one number, it is both the smallest and the largest.
Tip
min() and max() work on lists. Then low, high = pair splits the tuple back apart.
No comments yet. Start the discussion.