Solution:
def less_than_Avg(lis):
avg = sum(lis) / len(lis)
print("Average is:",int(avg))
return [i for i in lis if i < avg]
def main():
l = map(str, input("Enter elements of the list,separate with space: \n").split())
lis=[]
for i in l:
if '.' in i:
lis.append(float(i))
else:
lis.append(int(i))
print("Number(s) whose value is less than the average:",*less_than_Avg(lis))
main()
Comments
Leave a comment