mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00

committed by
cclauss

parent
b79a197e8c
commit
5f991f7740
14
maths/find_max.py
Normal file
14
maths/find_max.py
Normal file
@ -0,0 +1,14 @@
|
||||
# NguyenU
|
||||
|
||||
def find_max(nums):
|
||||
max = nums[0]
|
||||
for x in nums:
|
||||
if x > max:
|
||||
max = x
|
||||
print(max)
|
||||
|
||||
def main():
|
||||
find_max([2, 4, 9, 7, 19, 94, 5])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Reference in New Issue
Block a user