?
2013-09-14 07:12:22 UTC
lines = list()
x = int(input("How many numbers do you want to sort and average?"))
for i in range(x):
..........line = input("What's your number?")
..........lines.append(line)
print("Your numbers are:")
for line in lines:
..........print(line)
print("Your numbers in sorted order are:")
lines.sort()
print(lines)
print("The average of your numbers is:")
print(sum(lines), '/', len(lines))
input("Press the enter key to exit.")
The program works up to the following line:
print(sum(lines), '/', len(lines))
and then it prints the following error message:
Traceback (most recent call last):
File "C:/Users/Leandra/Desktop/Homework (Unknown Number).py", line 26, in
print(sum(lines), '/', len(lines))
TypeError: unsupported operand type(s) for +: 'int' and 'str'
Can someone please tell me what I'm doing wrong? I've looked over the program, and I don't see a reason for this not to work right.