b)Output
C)Input
ICT Question asap pls help
Answer:
I think it's input, not sure tho
Answer:
from functools import reduce
def mean(mylist):
score = reduce(lambda x,y: x + y, mylist)/ len(mylist)
return score
def median(mylist):
sorted(mylist)
list_len = len(mylist) % 2
i = round(len(mylist)/2)
x = len(mylist)//2
if list_len == 0:
median = (mylist[x] + mylist[x+1]) / 2
else:
median = mylist[i]
return median
def mode(mylist):
unique = set(mylist)
unique = list(unique)
collector = [mylist.count(key) for key in unique]
maxi = max(collector)
loc = collector.index(maxi)
return unique[loc]
def main():
scores = input( 'Enter list of numbers: ').split(",")
scores = [int(score) for score in scores]
operation = input('Enter operation: ')
operator = ['mean', 'median', 'mode']
for x in iter(list, 0):
if operation in operator:
break
print("Invalid operation: ")
operation = input('Enter operation')
index_loc = operator.index(operation)
if index_loc == 0:
return mean(scores)
elif index_loc == 1:
return median(scores)
#return np.median(scores) can be used of the defined function
elif index_loc == 2:
#return stats.mode(scores)[0] can be used of the defined function
return mode(scores)
print( main( ) )
Explanation:
The main python function calls conditionally three statistical functions namely mean, median and mode. It prompts for user input for a list of integer numbers and a function name name to return the corresponding result.
Answer:
The answer for the part of the operating system communicates with the BIOS, device drivers, resource managers, and APIs to coordinate operating system functions is theKernel.
Explanation:
The Kernel is the part of the operating system that is most visible to users.
It provides a reference point for activities in the operating system and coordinates operating system functions.
The kernel communicates with the BIOS, device drivers, and the API and handles the hardware, timing schedule, peripherals, memory, disks and user access.