Modify problem2.py to accept initial list-length term