Created
June 8, 2023 19:24
-
-
Save satsin06/a857ea78da4ddaa02d0fc65696bcb67f to your computer and use it in GitHub Desktop.
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
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