0

I am able to produce an output, but there is a space before each period that I do not know how to remove.

num = int(input())
numList=[]
add=0
for i in range(0,num):
    n = int(input())
    numList.append(n)
    add=add+numList[i]
avg=add/num
avg = float("{:.2f}".format(avg))
print("The grades you input are",numList,'.')
print("The average of the grades is",avg, '.')
print("The grades below the average are:")
for val in numList:
    if(val<avg):
        print(val)

For example, if the input is: 6 80 75 100 96 82 93

The output should be:

The grades you input are [80, 75, 100, 96, 82, 93].
The average of the grades is 87.67.

The output I am recieving is:

The grades you input are [80, 75, 100, 96, 82, 93] .
The average of the grades is 87.67 .
Barmar
  • 741,623
  • 53
  • 500
  • 612

0 Answers0