Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinpostal/f40561b74d3363c6f36471f2481d41f0 to your computer and use it in GitHub Desktop.
Save kevinpostal/f40561b74d3363c6f36471f2481d41f0 to your computer and use it in GitHub Desktop.
first_line = "3"
second_line = "1 2 4"
def main(first_line, second_line):
if int(first_line) != len(second_line.split()):
return False
else:
return sum((int(item) for item in second_line.split()))
if main(first_line="3", second_line="1 2 4") == 7:
print "Line Length Correct"
if not main(first_line="3", second_line="1 2 4 6 7"):
print "Incorrect Array Length"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment