Page 103 -
P. 103
sharing your code
1 Amend your module one last time to add a third argument to your function. Call your argument
indent and set it initially to the value False—that is, do not switch on indentation by default.
In the body of your function, use the value of indent to control your indentation code.
Note: to save a bit of space, the comments from the module are not shown here. Of course, you
need to make the necessary adjustments to your comments to keep them in sync with your code.
Put the extra argument
here.
def print_lol(the_list, , level=0):
What needs to
for each_item in the_list: go in here?
if isinstance(each_item, list):
print_lol(each_item, , level+1)
else:
Add a line of code
for tab_stop in range(level):
to control when
print("\t", end='')
indenting occurs.
print(each_item)
With your new code additions in place, provide the edit you would recommend making to the
2
setup.py program prior to uploading this latest version of your module to PyPI:
3 Provide the command you would use to upload your new distribution to PyPI:
you are here 4 67