Skip to content

Instantly share code, notes, and snippets.

@sampletext32
Last active December 24, 2020 17:46
Show Gist options
  • Save sampletext32/97150c360a26164816a901dc13a5aee9 to your computer and use it in GitHub Desktop.
Save sampletext32/97150c360a26164816a901dc13a5aee9 to your computer and use it in GitHub Desktop.
if __name__ == "__main__":
a = []
n = int(input())
for i in range(n):
element = int(input())
a.append(element)
index = 0
maxElement = a[0]
for i in range(n):
if a[i] > maxElement:
maxElement = a[i]
index = i
s1 = sum(a[:index])
s2 = sum(a[index + 1:])
if s1 > s2:
print("First sum is bigger")
elif s2 > s1:
print("Second sum is bigger")
else:
print("Equal")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment