Skip to content

Instantly share code, notes, and snippets.

@DonghyungKo
Created May 21, 2021 10:39
Show Gist options
  • Save DonghyungKo/fa8f80178f56e57e02788c50fcfa45ad to your computer and use it in GitHub Desktop.
Save DonghyungKo/fa8f80178f56e57e02788c50fcfa45ad to your computer and use it in GitHub Desktop.
Test #1
import argparse
parser = argparse.ArgumentParser(description="Sum two non-negative integers")
parser.add_argument("a", type=int, help="first non-negative integer")
parser.add_argument("b", type=int, help="second non-negative integer")
args = parser.parse_args()
if __name__ == "__main__":
a:int = args.a
b:int = args.b
if (a < 0) or (b < 0):
parser.print_help()
exit(1)
sum:int = a + b
print(sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment