Now you try!


#1



https://www.codecademy.com/en/courses/python-beginner-en-KAgt5/1/3?curriculum_id=4f89dab3d788890003000096


I am getting invalid syntax


cubes_by_four[x**3 for x in range(1,10) if (x**3)%4==0]
print cubes_by_four


#2

you want to result of list comprehension in a variable, assigning values to variable requires a single equal sign, which is missing in your case


#3

Also you should edit range(1,10) and change it into range(1,11)
Remember that the last number is not contained in the creation list of range function.
For example:
my_list=range(0,3) # [0,1,2]
my_list=range(0,4) # [0,1,2,3]


#4

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