Python/maths/find_min.py

18 lines
338 B
Python
Raw Normal View History

"""Find Minimum Number in a List."""
def main():
"""Find Minimum Number in a List."""
def find_min(x):
min_num = x[0]
for i in x:
if min_num > i:
min_num = i
return min_num
print(find_min([0, 1, 2, 3, 4, 5, -3, 24, -56])) # = -56
2018-10-28 21:23:29 +00:00
if __name__ == '__main__':
main()