howManyNames = (float(input("Enter how many student names do you want to enter? ")))
studentNames = []
ages = []
averageAge = 0
counter = 0
while (counter < int(howManyNames)):
studentNames.append(input("Enter student names. "))
ages.append(float(input("Enter that persons age. ")))
counter += 1
averageAge = sum(ages) / float(howManyNames)
while (ages[:] < int(averageAge)): ## crashes because its comparing a list < int
print ("Your age is below the average age.", ages)
if ages > averageAge:
print ("Your age is above the average age.", ages)
break
我收到错误消息 TypeError: unorderable types: list() < int() 我什至尝试了切片以查看是否有效.....