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
photoshop1234 [79]
3 years ago
11

Define the function max2 that takes two integers as arguments and returns the largest of them. Then define the function max_list t

hat returns the largest of the elements in a nonempty list of integers by calling max2
Computers and Technology
1 answer:
Serga [27]3 years ago
6 0

Answer:

def max_list(a):

   return max(a)

def max2(a,b):

   return max(a,b)

s=max2(2,3)

print('max of two number is:')

print(s)

a=[1,2,3,4,5,6,7,8,9,10]

max_in_list = max_list(a)

print('\n max element in whole list is:')

print(max_in_list)

Explanation:

Above program is written in python:

Function max2 accept two parameters and return one which is greatest of both and funtion max_list accept a parameter list and returns the greatest number in list.

Note: take care of indentation of function while pasting this code on your compiler or ide

You might be interested in
What method of research deals with large amounts of information that is analyzed and presented statistically?
Alenkinab [10]
Method of research deals with large amounts of information that is analyzed and presented statistically is quantitate.
6 0
3 years ago
In which situation is coauthoring of presentations primarily utilized?
Tanya [424]

Answer:

A i belive

Explanation:

3 0
3 years ago
Read 2 more answers
github Portfolio Balances An investor opens a new account and wants to invest in a number of assets. Each asset begins with a ba
OLEGan [10]

The following code will be used to determine the maximum amount invested

<u>Explanation:</u>

long maxValue(int n, int rounds_rows, int rounds_columns, int into rounds)

{

   // Define the variable to store

   // the maximum amount invested.

   long max = 0;

   

   // Define an array of size n,

   // to store the n investments.

   long *investments = (long*)malloc(sizeof(long)*n);

   int i=0;  

   // Initially set all

   // the investments to 0.

   for(i=0;i<n;i++)

   {

       investments[i] = 0;

   }

   i=0;

   // Run the loop to

   // perform the rounds.

   while(i<rounds_rows)

   {

       // Get the left value

       // of the current round.

       int left = rounds[i][0];

       

       // Get the right value

       // of the current round.

       int right = rounds[i][1];

       // Get the contribution

       // for the current round.

       int contribution = rounds[i][2];

       // Since the user uses 1-based

       // indexing, subtract 1 from left

       // and right as the program uses

       // 0-based indexing. That is, the

       // investments in the array start

       // from 0 and not 1.

       right = right - 1;

       int j=0;

       // Run the loop to add the

       // contribution to all the investments

       // between left and right, both inclusive.

       for(j=left; j<=right; j++)

       {

           investments[j] += contribution;

       }

       i++;

   }

   // Traverse the investments array

   // to find the maximum element.

   max = investments[0];

   for(i=1; i<n;i++)

   {

       if(investments[i]>max)

       {

           max = investments[i];

       }

   }

   // Return the

   // maximum investment.

   return max;  

}

6 0
4 years ago
When powering up the computer, the initial program loading and start-up is performed by using a ______________ program that is b
vitfil [10]

Answer:

The answer is Bootsrap

Explanation:

A bootstrap program which is also referred to as a bootstrap loader is a program that resides in the computer’s Read Only Memory. It starts the whole chain reaction and ends up with the entire OS being loaded. This program reads the computer’s hard drive boot sector and continues with the process of loading the Operating System. It first performs a POST test and then proceeds to load the OS intothe main memory.

4 0
4 years ago
Before starting a spreadsheet, it is smarter to plan ahead and think through the design. true or false
Nesterboy [21]
True. THe axis order (horizontal/vertical) for instance, can cause a serious headache to you when organized wrong.
The same goes with functions, it's better to check them mentally/in a piece of paper beforehand.
6 0
3 years ago
Other questions:
  • Text filters allow you to create a custom filter to match ________ the text in a field that you specify.
    7·1 answer
  • A _______ record is responsible for resolving an ip to a domain name.
    9·1 answer
  • Which css property is used to change the text color of an element?
    15·1 answer
  • Bob has been assigned to set up a digital certificate solution for use with e-mail. One of the requirements he has been given is
    10·1 answer
  • What is used to determine when the communications channels are clear and when a device is free to transmit data
    6·1 answer
  • A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
    12·1 answer
  • Write a method that accepts a String object as an argument and returns a copy of the string with the first character of each sen
    14·1 answer
  • Which device uses radio waves? ceiling fan microwave oven air conditioner x-ray machine?
    7·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • Write the algorithm for finding the perimeter of a rectangle using English like form step by step
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!