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)
print ("Your average age is ", averageAge, "!")
for age in ages:
if age < int(averageAge):
print ("Your age is below the average age.", age)
else:
print ("Your age is above the average age.", age)
ソート機能を使用しようとすると問題が発生します print sort(ages) print ages.sort() などを試しましたが、何も機能していないようです。