Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 12, 2022 04:46
Show Gist options
  • Select an option

  • Save RaMSFT/5897c85e16f84f2473f7244b35f2333c to your computer and use it in GitHub Desktop.

Select an option

Save RaMSFT/5897c85e16f84f2473f7244b35f2333c to your computer and use it in GitHub Desktop.
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