Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 9 def contains(txt, letters): rtn = [] alist = txt. split for W in aLis

ID: 3604795 • Letter: Q

Question

Question 9 def contains(txt, letters): rtn = [] alist = txt. split for W in aList: if w in letters: rtn.append (w) return rtn burns = "a man's a man for a' that " print (contains (burns, 'abc')) a. () b. ('a', 'a'] C. it's a d. ('a", "man's ", a', ' man", "a", 'that'] e, none of the above " Question 10 def fileCount(fileName, S): inF = open(fileName) count = 0 content = inF. read(O) for thing in content: if s in thing: count += 1 inF. close(O) return count W = open('seuss.txt, 'w') w.write('You are on your own ' + ' ') w.write(' and you know what you know'+ ' ') w.close ( print (fileCount('Seuss.txt', 'you')) a. 2 b. 3 c. 4 d. FileNotFoundError e, none of the above

Explanation / Answer

Question 9
Answer: b. ['a', 'a']
'a' is a word in txt string variable. so 'a' exists in letters string variable so list will contain two 'a'

Question 10
Answer:a. 2
you word exists twice in second line so count will return 2

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote