Question: How do I stop this error? scoreln = int ( input ( ) ) ValueError: invalid literal for int ( ) with base 1 0

How do I stop this error?
scoreln =int(input())
ValueError: invalid literal for int()with base 10: '99.1'
I want to be able to add decimal inputs
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())
print()
average =sum /i
scoresGTECtr =0
scoresLTCtr =0
print("Total scores entered: "+str(i))
for index in range(i-1,-1,-1):
if scores[index]>=average:
scoresGTECtr =scoresGTECtr +1
scoresGTEListing =scoresGTEListing +str(scores[index])+""
else:
scoresLTCtr =scoresLTCtr +1
scoresLTListing =scoresLTListing +str(scores[index])+""
print("Average score: "+str(average))
print("Number of scores greater than or equal to the average: "+str(scoresGTECtr))
print("The scores greater than or equal to the average are: "+scoresGTEListing)
print()
print("Number of scores less than the average: "+str(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!