Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes

How do you append to your list of scores and then multiply by them?

I have scoreList= [] before my for loop. and i tried to use scoreList = scoreList.append("score") to add the inputted scores into a list.

My error message says: "NoneType" object has no attribute 'append'

any help is appreciated ^^

EDIT: My problem was that i did not need the scoreList = ..... , i only needed the scoreList.append(score)

asked in CSC201 Spring 2021 by (1 point)
edited by
+3

It should be
scoreList.append(score)
score will be the input that you will be taking from the user
P.s all of this will help in the for loop but your scorelist =[] will be out of loop

2 Answers

+4 votes

it should be scoreList.append(score)

answered by (1 point)
+1

still same error :(

+1

did you create scoreList outside of the main function?

+1

it is in the drawBarGraph function

+1

Got it!!!

+4 votes

When typing scoreList = scoreList.append("score"),
you are setting the scoreList to be the appended score but because it had no values initially, you can't append the score. Hope that makes sense,
so rather just have scoreList.append("score")

answered by (1 point)
...