Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Kalpak Take authored Jan 31, 2017
1 parent d44ee79 commit 16161eb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions max_int_in_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

def compare(li):
res = 0
for i in range(len(li) - 1):
a = li[i]
b = li[i + 1]
if (a > b):
if (a > res):
res = a
else:
if (b > res):
res = b
return res

def convert():
get_input = raw_input("Enter Space Seperated Numbers : ")
raw = get_input.split()
nums = []
for i in raw:
nums.append(float(i))
return nums

if __name__ == "__main__":
print compare(convert())

0 comments on commit 16161eb

Please sign in to comment.