0

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?

Ish
  • 95
  • 1
  • 7

1 Answers1

1

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
Gilseung Ahn
  • 2,598
  • 1
  • 4
  • 11