subject

Def find_max(nums: [int]) -> int: '''
Finds the maximum value in the given list of integers,
or None if the list is empty
'''
largest = None

for num in nums:
if largest == None or num > largest:
largest = num

return largest

Rewrite the find_max function so that it uses recursion to work its way through the list instead of using a loop. Your rewritten function should accept the same kinds of inputs (i. e., a one-dimensional list of integers) and generate the same outputs. In your view, is this a problem that's well-suited to a recursive solution in Python.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
Q-3 a technician is setting up a computer lab. computers on the same subnet need to communicate with eachother peer to peer communication,a. hardware firewallb. proxy serverc. software firewalld. gre tunneling
Answers: 3
question
Computers and Technology, 22.06.2019 00:10
How does access indicates that a filter has been applied to a specific column
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
You know the right answer?
Def find_max(nums: [int]) -> int: '''
Finds the maximum value in the given list of integer...
Questions
question
Mathematics, 21.04.2021 19:20
question
English, 21.04.2021 19:20
Questions on the website: 13722362