PYTHON CHECK SIMPLE CODE Write a recursive function findTitles () that takes a s
ID: 3678725 • Letter: P
Question
PYTHON CHECK SIMPLE CODE
Write a recursive function findTitles() that takes a string representing a name of a directory as a parameter and returns a list of all the titles found inside the html files in that directory or subdirectories of that directory, etc. Files that appear in more than one directory will only appear once in the title list returned. The titles in the list do not have to be ordered in any particular way.Please note that your functionmust be recursive and that it must work as described on any directory and file structure, not just the ones provided as examples. You may not make any assumption about the nesting of subdirectories, either with respect to how many subdirectories exist at each level or how deep the nesting of subdirectories is. You may not change the number of parameters of the function, define any helper functions, or use any global variables, and the function must return and not printthe list of unique files. It is expected that a correct recursive solution to the problem will contain at least one loop. Your code must work on any operating system
Python 3.5.0 Shell File Edit Shell Debug Options Window Help Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC v.1900 32 bit (In- tel)1 on win3:2 Type "copyright", "credits" or "license " for more information. >>crawler-Crawler) crawler.crawl ('http://facweb.cdm.depaul.edu/asettle/csc242/web/fEOne.html' >>> crawler·titles 'First test page' 'Test page'1 >>> crawler-Crawler O >crawler.crawl ('http://facweb.cdm.depaul.edu/asettle/csc242/web/one.html' >>>crawler.titles II'Page One', 'Page Three','Page Four', ['Page Five', ['Page Two'11Explanation / Answer
"To see if the string 'Python' is located on the page http://python.org":
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.