Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions maths/FindMin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
def main():
def findMin(x):
minNum = x[0]
for i in x:
if minNum > i:
minNum = i
return minNum
def find_min(nums):
min = nums[0]
for x in nums:
if min > x:
min = x
return min

def main():
print(findMin([0,1,2,3,4,5,-3,24,-56])) # = -56
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify this line to match find_min as well so that the code would compile.


if __name__ == '__main__':
Expand Down