Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part (c) (2 MARKS] Consider the following module: from typing import List def f3(1st: List[int]) > float: n-0 total - 0 for item in lst:

image text in transcribed

Part (c) (2 MARKS] Consider the following module: from typing import List def f3(1st: List[int]) > float: n-0 total - 0 for item in lst: if item % 2 - 0: total + item n+ 1 return total / n def f2(1st: List[int]) -> float: return f3(1st) def f1(1st: List[int]) -> float: try: return f2(1st) except ZeroDivisionError: print('Ouch!) return 0.0 if __name__ - '__main__': print(f1([3, 21, 85, 11, 7])) 1. How many stack frames are on the call stack, including the frame for __main.., when an error is raised? 2. When the error is raised, how many stack frames are popped off the stack before "Ouch!" is printed

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago