# This program permanently deletes files ending with a .txt extension
#
# Note:
# - Demonstrates testing with delete functions
import os
for filename in os.listdir('./'):
    if filename.endswith('.txt'):
        #os.unlink(filename)
        print(filename)  # DEBUG

"""Delete

This program permanently deletes files ending with a .txt extension in the current directory
using :py:mod:`os`.

Note:
    Demonstrates testing/debugging using comments.

"""


def main():
    import os
    for filename in os.listdir('./'):
        if filename.endswith('.txt'):
            #os.unlink(filename)
            print(filename)  # DEBUG


if __name__ == '__main__':
    main()

Update P1_delete.py added docstring and wrapped in main() function