Answer:
D)One big superclass can be used instead of many little classes.
Explanation:
Inheritance could be described as getting new class on another existing class with almost same execution,
inheritance allows codes to be re-used. It should be noted that inheritance bring about the code sharing among class.
The advantages of using inheritance includes but not limited to
✓ Code that is shared between classes needs to be written only once.
✓Similar classes can be made to behave consistently.
✓ Enhancements to a base class will automatically be applied to derived classes.
Answer:
See explaination
Explanation:
def readFileFirstLast(filename):
# doc string
''' Function accept the filename and opens the fle
and reads all lines and strips new line character and
stores first and last in a string and return that string'''
#eception handle if file not found
try:
#opening the file
f = open(filename)
#reading the first line and striping the ne line
string = f.readline().strip()
#iterating until last line
for line in f:
pass
#concate the last line after strip the new line character to the string
string = string + " " + line.strip()
#return the string
return string
except:
#if file not found
return "File not found"
#taking the file name from user
filename = input("Enter a file name: ")
#printing the doc string in function
print("\ndoc_sting: \n"+ readFileFirstLast.__doc__+"\n")
#printing the returned string by calling the readFileFirstLast()
print("output string :")
print(readFileFirstLast(filename))
Grace Murray Hopper invented it
Answer:
The answer to this question is given below in the explanation section
Explanation:
Bulleted and Numbered List button appear in the <u>Paragraph </u>Toolbar.
On word processing software, these options display in paragraph toolbar in the Home ribbon.
for example, in MS Word, you can find them in the Home tab under paragraph groups of command.
however, it is noted that these options are appear in some other software under the formating toolbar.
Answer:
b. The names in the list should be in alphabetical order.
Explanation:
A binary search is an algorithm used for searching for an item in a list or array. The algorithm first sorts the data structure into order and then divides it into halves. If the searched item is less than the middle item in the list, then the algorithm searches for the target in the first half, else, in the second half. This reduces the time complexity of the search.