N = int(input())
Speed_limit_car_count = 0
all_speed = 0
car_speed = []
i = 0
total = None
YN = None
def list_check(car_speed):
for i in range(len(car_speed)):
if car_speed[i] in range(1, 300):
normal = True
continue
else:
normal = False
break
return normal
if N not in range(1, 31):
print('Wrong input')
else:
while i < N:
car_speed.append(float(input()))
i += 1
normal = list_check(car_speed)
if normal:
for i in range(len(car_speed)):
if car_speed[i] <= 30:</p>
Speed_limit_car_count += 1
for i in range(len(car_speed)):
round(car_speed[i])
all_speed += car_speed[i]
total = all_speed/N
if Speed_limit_car_count >= 2:
YN = 'YES'
else:
YN = 'NO'
else:
print('ERROR IN SPEEDLIST. CHEK INPUT!')
print(total, YN)
Программа протестирована. ctrl+c делать не стоит, сайт нарушает табуляции в коде.