Last active
April 2, 2019 08:37
-
-
Save prmishra/e68e582c7640704ab4cb8ba7d25b5097 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 os | |
import sys | |
def find_min(): | |
# implement your logic here | |
pass | |
def print_usage(): | |
print("Usage:- python {} space-separated-integers".format( | |
os.path.basename(__file__), | |
)) | |
def parse_arg(): | |
parsed_list = [] | |
for value in sys.argv[1:]: | |
try: | |
parsed_list.append(int(value)) | |
except ValueError: | |
print_usage() | |
exit(1) | |
return parsed_list | |
if __name__ == "__main__": | |
if len(sys.argv) > 1: | |
input_list = parse_arg() | |
find_min() | |
else: | |
print_usage() | |
exit(1) | |
# python script.py 1 2 3 5 7 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment