Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 8 bool_exprs[True or False, True, True and False, not False] accumulator = for expr in bool_exprs: if expr True: accumulator += 1 accumulator *-2

image text in transcribed

Question 8 bool_exprs[True or False, True, True and False, not False] accumulator = for expr in bool_exprs: if expr True: accumulator += 1 accumulator *-2 continue break print (accumulator) a) 14 c) 2 d) 6 e) none of the above Question 9 q = 'What is the Matrix?' def splitLength(t): rtn = alist - t.split() for s in aList: rtn += len(s) return rtn print (splitLength(q)) a) 19 c) 15 d) 16 e) none of the above Question 10 def occurrences (fileName, searchStr): inF open( fileName) for line in inF: lineLower line. lower() rtnVal +lineLower.count (searchStr) inF.close() return rtnVa1 seuss = open ( . you . txt', 'w') seuss.write( 'Today you are You, that is truer than true.'+ 'n') seuss.write( 'There is no one alive who is Youer than You.'+'n') seuss.close() print(occurrences('you.txt', 'you')) seuss.close() a) 3 d) 2 e) none of the above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago