-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kalpak Take
authored
Jan 31, 2017
1 parent
d44ee79
commit 16161eb
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |