Codington
0 of 6 problems solved • 0%

Exercise prompt

Double the Readings

A list comprehension can express a loop that creates one result for each input. A new list keeps the original measurements available.

Example

Build one short label per book.

books = ["Orbit", "North Star"] labels = [book.upper() for book in books] print(labels) # ['ORBIT', 'NORTH STAR']

Read the for clause first: it names the current item. The expression before it supplies the new value. The original book titles keep their spelling.

Your task

Complete double_readings(readings). Return a new list with every measurement multiplied by two, in the same order. Try using a list comprehension.

double_readings([2, -3, 0]) # [4, -6, 0]