0

Problem in python

Why is the list name shown as none after appending an element. What does that that "None" mean? I am new to programming and I have just started with python. Please ignore any silly mistakes by me. https://code.sololearn.com/c89McJc8Up4f/?ref=app

19th Oct 2020, 3:42 PM
<k>Kartik</k>
6 Answers
+ 2
You have to declare firstly your added_state variable as empty list.then assign to it state list .Or you have to remove assignment and append directly to state list with no need to added_state variable
19th Oct 2020, 3:54 PM
HBhZ_C
HBhZ_C - avatar
+ 1
Thanks Avinesh & HBhZ_C
19th Oct 2020, 6:56 PM
<k>Kartik</k>
+ 1
HBhZ_C thanx once again.
19th Oct 2020, 7:07 PM
<k>Kartik</k>
0
HBhZ_C can u plz tell me how will I declare my variable empty
19th Oct 2020, 7:01 PM
<k>Kartik</k>
0
You will declare an empty list .Here you declare added_state = [] with no value.Then you can append to it.
19th Oct 2020, 7:04 PM
HBhZ_C
HBhZ_C - avatar