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
Answer: SOFTWARE
Explanation: Software is a set of instructions, data or programs used to operate computers and execute specific tasks. It is the opposite of hardware, which describes the physical aspects of a computer. Software is a generic term used to refer to applications, scripts and programs that run on a device.
A plotter is a special output device used to produce hard copies of large graphs and designs on paper, such as construction maps, engineering drawings, architectural plans and business charts.
~
Computer output devices receive information from the computer, and carry data that has been processed by the computer to the user. Output devices provide data in myriad different forms, some of which include audio, visual, and hard copy media.
~
They are electroacoustic transducers, which convert an electrical signal to a corresponding SOUND.
Answer:
A key benefit of inheritance is: an object can have several types, it is type compatible with any of its super classes
Explanation:
- Inheritance is one of the fundamental concepts of Object Oriented Programming.
- Inheritance allows classes (derived classes) to inherit the methods and properties of a class (base class).
- The class or classes that inherits the characteristics from another class is called a derived class, child class or sub class. Derived class can also has it own methods and attributes additionally.
- The class whose methods and properties are inherited by the derived class or classes is called a base class, super class or a parent class.
- Benefit of inheritance is that inheritance new objects can take properties of existing objects and an object can have many types.
- Also a child class can inherit from more than one super classes which is called multiple inheritance.
- Multiple inheritance allows a class to implement more than one abstract classes.
- An object can have several types. These types can be of an object's own class and also other types which include all classes that a class inherits.
- If a variable is declared to be the type of super class then value of that variable can refer to any instance that instantiated from any class that inherits that super class. This means that an object is type compatible with an of its super classes.