Update FindMax.py (#588)

Issues in previous code:
`Line 3` math module is not used so we don't have to import it
`Line 5`, `max = 0` will give wrong answer (0) when the list contains only -ve elements, as 0 will always be larger than the elements.
This commit is contained in:
Ashwek Swamy 2018-11-01 19:25:28 +05:30 committed by Libin Yang
parent d8e33020b4
commit 32db8be93e

View File

@ -1,8 +1,7 @@
# NguyenU
import math
def find_max(nums):
max = 0
max = nums[0]
for x in nums:
if x > max:
max = x