Reversing a List 9/18


#1

Can someone help me please?

Here's my code:

  my_list = range(1, 11)

# Add your code below!
  backwards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  print backwards[::-1]

Here's what it printed:

[11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
None

Here's my error:

Oops, try again. Make sure to use list slicing and a negative stride in your answer!

I'm not sure what I'm doing wrong.
Thank You,
Fiona


#2

my_list = range(1, 11)
backwards = my_list[::-1]
print backwards
HERE IS MY CODE
you cant have a function after backwards LOL


#3

Apply the slicing to my_list instead

my_list = range(1, 11)

# Add your code below!
backwards = my_list[::-1]
print backwards

#4

my_list = range(1, 11)
backwards=[10,9,8,7,6,5,4,3,2,1]
print my_list[::-1]