Question: Keep getting the error: can only concatenate str ( not int ) to str print ( Total scores entered: + i ) scores

Keep getting the error: can only concatenate str(not "int") to str
print("Total scores entered: "+ i)
scores =[0]*(100)
scoresGTEListing =""
scoresLTListing =""
sum =0
i =0
scoreln =0
print("Enter a score or negative number to exit: ")
scoreln = int(input())
while scoreln >=0:
scores[i]= scoreln
sum = sum + scoreln
i = i +1
print("Enter a score or negative number to exit : ")
scoreln = int(input())
average = sum / i
scoresGTECtr =0
scoresLTCtr =0
print("Total scores entered: "+ i)
for i in range(i -1,0-1,-1):
if scores[i]>= average:
scoresGTECtr = scoresGTECtr +1
scoresGTEListing = scoresGTEListing +""+ scores[i]
else:
scoresLTCtr = scoresLTCtr +1
scoresLTListing = scoresLTListing +""+ scores[i]
print("Average score: "+ average)
print("Number of scores greater than or equal to the average: "+ scoresGTECtr)
print("The scores greater than or equal to the average are: "+ scoresGTEListing)
print("Number of scores less than the average: "+ scoresLTCtr)
print("The scores less than the average are: "+ scoresLTListing)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!