num = []
count = 0
while 1:
a = int(input())
if a == 0: break
elif count == 100: break
elif a > 300:
continue
num.append(a)
count += 1
num = list(filter(lambda x: (x % 8 == 0), num))
print(round(sum(num)/len(num), 1)) if len(num) != 0 else print("NO")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
num = []
count = 0
while 1:
a = int(input())
if a == 0: break
elif count == 100: break
elif a > 300:
continue
num.append(a)
count += 1
num = list(filter(lambda x: (x % 8 == 0), num))
print(round(sum(num)/len(num), 1)) if len(num) != 0 else print("NO")