Python Novice. Need to create a list which is a reverse of the previous list. Ran the follow code:
list_10 = [1,10,20,4,40,14]
list_11 = list_10.reverse()
print (list_11)
I get an output that says "None"
Any suggestions?
Python Novice. Need to create a list which is a reverse of the previous list. Ran the follow code:
list_10 = [1,10,20,4,40,14]
list_11 = list_10.reverse()
print (list_11)
I get an output that says "None"
Any suggestions?
Because reverse()
reverses the list in place, it returns none.
Try this.
list_10 = [1,10,20,4,40,14]
list_10.reverse()
list_11 = list_10