Created
October 12, 2022 04:46
-
-
Save RaMSFT/5897c85e16f84f2473f7244b35f2333c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def find_smallest_num(lst): | |
| """Find the smallest number from the list | |
| Args: | |
| lst (Numeric): a list of numbers | |
| Returns: | |
| Numeric: return the smallest of all numbers in the list | |
| """ | |
| return min(lst) | |
| print(find_smallest_num([34, 15, 88, 2])) # 2 | |
| print(find_smallest_num([34, -345, -1, 100])) # -345 | |
| print(find_smallest_num([-76, 1.345, 1, 0])) # -76 | |
| print(find_smallest_num([0.4356, 0.8795, 0.5435, -0.9999])) #-0.9999 | |
| print(find_smallest_num([7, 7, 7])) # 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment