我已经有了这么多,我只是不明白如何让它读取一个未指定的数字。
NUMBER_OF_SCORES = (1-100):
numbers = []
sum = 0
for i in range(NUMBER_OF_SCORES):
value = eval(input("Enter a new number: "))
numbers.append(value)
sum += value
average = sum / NUMBER_OF_SCORES
count = 0 # The number of elements above average
for i in range(NUMBER_OF_SCORES):
if numbers[i] > average:
count += 1
count1 = 0
for i in range(NUMBER_OF_SCORES):
if numbers[i] < average:
count1 += 1
stop = "stop"
if numbers (1<=100):
print("Average is", average*2)
elif numbers (stop):
print("Number of elements above the average is", count)
else:
print("sorry i don't understand.")"