Question: doctest.py untitled - 1 . py ef tim _ max ( keys ) : returns the maximum value in the keys tim _ max (

doctest.py
untitled-1.py
ef tim_max(keys):
returns the maximum value in the keys
tim_max ([4,10,3,2,5])
10
> tim_max ([2])
2
tim_max ([-1,-4])
-1
"#>tim_max (L-3,10,99])
"t"
comparison_count =0
max_so_far =0
for i in range(len(keys)):
if keys [i]> max_so_far:
max_so_far = keys i
return max_so_far
if ="_":
import doctest
doctest.testmod()
Search
Stack Data
Search:
Commands execute without debug. Use arrow keys for history.
Options
Replace:
Case sensitive
Whole words
In Selection
Next
Replace
Replace All
Options
Python 3.12.4(v3.12.4:8e8a4baf65, Jun 62024,17:33:18)[C7ang 13.0. Type "help", "copyright", "credits" or "license" for more information. >>[evaluate
untitled-1.py]
Traceback (most recent call last) :
File "/Users/jeremiahs/untitled-1.py", line 21, in
doctest.py
untitled-1.py
ef tim_max(keys):
returns the maximum value in the keys
tim_max ([4,10,3,2,5])
10
> tim_max ([2])
2
tim_max ([-1,-4])
-1
(
doctest.py untitled - 1 . py ef tim _ max ( keys

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!