Skip to content

Instantly share code, notes, and snippets.

@satsin06
Created June 8, 2023 19:24
Show Gist options
  • Save satsin06/a857ea78da4ddaa02d0fc65696bcb67f to your computer and use it in GitHub Desktop.
Save satsin06/a857ea78da4ddaa02d0fc65696bcb67f to your computer and use it in GitHub Desktop.
import sys
def adding(x, y):
return x + y
def main():
if len(sys.argv) != 3:
print("Please provide two numbers as command-line arguments.")
else:
x = int(sys.argv[1])
y = int(sys.argv[2])
result = adding(x, y)
print(f"Sum of {x} and {y} is {result}")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment