CS193q Homework - Printly

Create a new printly.py file. You may copy our program1.py example as a starting point.

1. Write a function printly(strs) that takes in a list of strings, and prints them out one per line.

2. Write logic in main() to handle the following two cases of args:

a. args is just 1 or more words. In this case, just print out the words 1 per line (calling your printly function).

$ python3 printly.py This is it
This
is
it

b. If the first two args are '-n' and a number. In that case, print N copies of the words, 1 per line. Use a loop and slicing to call your printly function to do this.

$ python3 printly.py -n 5 This is it
This
is
it
This
is
it
This
is
it
This
is
it
This
is
it