List Comprehension: introduction grades

https://www.codecademy.com/courses/learn-python-3/lessons/learn-python-loops/exercises/list-comprehension-ii

Hi all, I cannot complete this lesson (link above). I tried to follow the syntax in the example script but my answer has not been accepted.

code academy asks if i have added 10 to all grades, but i seemingly have based on the results of the print statement.
Please let me know your thoughts. thanks!

ades = [90, 88, 62, 76, 74, 89, 48, 57] scaled_grades = [] for grade in grades: scaled_grades.append(grade + 10) print(scaled_grades)

The lesson is on list comprehensions and the question asks you to specifically write a list comprehension, not a function. So you have to write a lc if you want it to pass.

Check out the hint below the question, “new_list = [<expression> for <element> in <collection>]

So, that said, how would you write it?

scaled_grades = [ ???]

2 Likes

thanks!. sometimes i skim the text in the lesson and focus on the code snippets. Will try to pay better attention!

1 Like

Sure thing. :slight_smile: Yea, I wouldn’t skim the text parts as there’s key learning info and concepts you can delve further into.