The time has come to separate even numbers from odd. You must write a
separate.py that will take a list of integers as command line arguments,
and then it will print out first a sorted list of the even numbers and second
a sorted list of the odd numbers. For example:
$ python hw6.py 1 3 482 394 10 29 [10, 394, 482] [1, 3, 29] $ python hw6.py 7 13 42 101 5 666 0 [0, 42, 666] [5, 7, 13, 101]
In English, try to write down a step-by-step procedure for how this program will work. You should have roughly one step for each line. After you’ve given it your best shot, take a look at the algorithm I came up with.
Now that you’ve got the algorithm figured out, try to write out the code. Take a look at my code if you get stuck.
# separate.py import sys evens =  odds =  for arg in sys.argv[1:]: n = int(arg) if n % 2 == 0: evens.append(n) else: odds.append(n) print(sorted(evens)) print(sorted(odds))