1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vaselesa [24]
3 years ago
5

Def find_max(nums: [int]) -> int:

Computers and Technology
1 answer:
SIZIF [17.4K]3 years ago
8 0

Answer:

The program in recursion is:

def find_max(nums):

    if len(nums) == 0:

         return "None"

    elif len(nums) == 1:

         return nums[0]

    else:

         return max(nums[0],find_max(nums[1:]))

Explanation:

This line defines the function

def find_max(nums):

This checks if the list is empty.

    if len(nums) == 0:

If yes, it returns "None"

         return "None"

If the list has just one element

    elif len(nums) == 1:

It returns the only element as the maximum

         return nums[0]

If the list has numerous elemente

    else:

The maximum is determined recursively

         return max(nums[0],find_max(nums[1:]))

To the (b) part:

<em>This program does not necessarily need to be done recursively because the max built-in function can be used to determine the maximum of the list in just one line of code and it is more efficient.</em>

You might be interested in
Write a program that reads and unspecified number of integers, determines how many positive and negative values have been read,
KonstantinChe [14]

Answer:

The program was wrote in the version 3.9.5 of python and it's in the homework.txt file.

Download txt
6 0
3 years ago
If the ____________ is broken on a laptop, chances are other parts are also broken.
ella [17]
Central processing Unit
8 0
3 years ago
4. What are five actions you should do to care for your camera?
den301095 [7]
Adding to the one above,
Keep food or drinks away from the camera
7 0
3 years ago
Match the feature to its function.
kolbaska11 [484]

Answer:

Match the feature to its function.  The answers are as below:

1. Normal view the place where creating and editing occurs  

2. Notes view an area in which information for handouts can be added  

3. Slide pane the place where the slide order can be changed

4. Menu bar contains lists of commands used to create presentations  

5. toolbars provide rows of icons to perform different tasks  

Explanation:

It is the normal view where the editing and the creation of the slides occur. And it's the notes view where you can add the information for handouts. You can arrange the slides in the slide pane. And you can get a list of commands for creating the presentation in the Menu bar. Also, Toolbar is the rows of icons which helps in performing a various set of tasks. And all these are definitions and prove our above selections are correct.

6 0
3 years ago
Your job is to write a basic blurring algorithm for a video driver. The algorithm will do the following: it will go through all
nekit [7.7K]
I’m pretty sure answer is B let me know if I’m wrong
4 0
4 years ago
Other questions:
  • Who controls communication ethics?
    13·1 answer
  • Describe your microsoft word skills that need to be improved upon the most.<br><br>​
    8·1 answer
  • The Earth's _______ is ductile overall, tending to flow very slowly and deform in a _______ manner.
    14·2 answers
  • "You are setting up a new subnetwork on an existing network. Management has asked that you use existing cabling that the company
    14·1 answer
  • Random access memory is the portion of a computer's primary storage that does not lose its contents when one switches off the po
    6·2 answers
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • 2x + 3y = 11<br>y = x-3​
    8·2 answers
  • QUESTION 56 Use the Windows ________ to check on a nonresponsive program. Backup utility Error-checking System Restore Task Mana
    6·1 answer
  • Theresa is not sure how nondestructive editing can be helpful in her project. Which of these is accurate about nondestructive ed
    8·1 answer
  • Tightly.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!