muremwa / max-min-number-lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maximum and Mininum Number in a list

You need to get the min and max number in a list.

Your answer should be returned in an array containing the min and max number, respectively, as follows [min, max]

In cases where the min and max numbers are equal, return an array with just the number, as the first index [number]

Here are some examples

[1, 2, 3] should return [1, 3]

[1, 0, 8, 3] should return [0, 8]

[-1, -55, -2] should return [-55, -1]

[1, 1, 1] should return [1]

How to Run this Lab

Fork this Repository, then Clone forked repository Open the file named maxAndMinNumbers.py and start coding

Notes

Remember that passing code is just the first step. The goal is to work towards a solution that is as readable and expressive as you can make it.

Please make your solution as general as possible. Good code doesn't just pass the test suite, it works with any input that fits the specification.

Have fun!

About


Languages

Language:Python 100.0%