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
Video games, regardless of their level of realish, had added a new dynamic to the world games and Entertainment the ability to s
Damm [24]

Answer:

to simulate real life ??

8 0
3 years ago
Java uses a right brace to mark the end of all compound statements. What are the arguments for and against this design?
Vlada [557]

Explanation:

The argument is for the right braces.The right braces are used for simplicity.The right brace always terminates a block of code or a function.

The argument against right brace is that when we see a right brace in a program,we are not obvious about the location of the corresponding left brace because all or multiple  statement end with a right brace.

7 0
3 years ago
By what date must federal taxes typically be filed and sent to the IRS?
marishachu [46]
April 15th of each annual year
6 0
4 years ago
Implement a simplified version of a crypto broker platform. Initially, there is an array of users, with each user depositing onl
Salsk061 [2.6K]
Jriririiekeekekkksks
3 0
3 years ago
This is a bit confusing to me. Could someone please help me! I have to use CSS to Design a Web Page. I will mark Brainliest!
GrogVix [38]

Answer:

CSS is easy

Explanation:

CSS is like the color or your sylte for a webpage.

6 0
3 years ago
Other questions:
  • The different between a compiler and a translaror
    9·2 answers
  • Jamie works on a spread sheet in which he has to label stes of data. How can he navigate between the cells in the spread sheet
    8·1 answer
  • Before you enable data deduplication, what tool can you use to determine if data deduplication would benefit the tested volumes
    11·1 answer
  • QUESTION
    14·1 answer
  • In the view that follows, which field can't be updated create view example_2 as select invoice_number, invoice_date, invoice_tot
    13·1 answer
  • Which of the following actions would not reduce software piracy? reducing the cost of software. offering downloads of software.
    12·2 answers
  • Write a technical term for following statements
    15·1 answer
  • Which of the following traversals would print all of the elements in the 2D array of integers nums
    14·1 answer
  • Code used when creating a hyperlink to a specific part of the same page.
    15·1 answer
  • Write a python program to change variable value of your previous result percentage to your current percentage of mid-term
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!