Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
iynix committed Dec 2, 2022
1 parent 93cab2f commit e90b6f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,20 @@ def convert_numbers(list_of_strings):
def parse_args():
parse = argparse.ArgumentParser(description='calculate square')
parse.add_argument('numbers',type=str, nargs='+',help='a list of number strings')
parse.add_argument('weights',type=str, nargs='+',help='a list of weight strings')
args = parse.parse_args()
return args


if __name__ == "__main__":

args = parse_args()
weight_strings = ["1","1","1"]

# weight_strings = ["1","1","1"]
# input as "1 2 4" "1 1 1"
numbers = convert_numbers(args.numbers)
weights = convert_numbers(weight_strings)

print(numbers)
weights = convert_numbers(args.weights)
print(weights)
result = average_of_squares(numbers, weights)

print(result)

0 comments on commit e90b6f4

Please sign in to comment.