8. Omitting indices - code correct, but doesn't work


#1

Here's a link to the exercise:
https://www.codecademy.com/courses/python-beginner-en-KAgt5/2/2?curriculum_id=4f89dab3d788890003000096

My code:

my_list = range(1, 11) # List of numbers 1 - 10

# Add your code below!
 print my_list[::2]


This is the error I get from the console:

File "python", line 4
print my_list[::2]
^
IndentationError: unexpected indent

This is what it says at the bottom:

Oops, try again. Did you accidentally delete the my_list list? Reset your code to try again.


I looked at other Q&As to this exercise and all of them worked using this code. I don't know what I did wrong.


#2

print needs to be all the way on the left. Python uses something called whitespace. Take the space out of the beginning of the print line.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.