diff --git a/comprehensions.html b/comprehensions.html index d95f0ed..9ecb1e1 100644 --- a/comprehensions.html +++ b/comprehensions.html @@ -192,12 +192,12 @@ body{counter-reset:h1 3}
A list comprehension provides a compact way of mapping a list into another list by applying a function to each of the elements of the list.
->>> a_list = [1, 9, 8, 4] ->>> [elem * 2 for elem in a_list] ① +>>> a_list = [1, 9, 8, 4] +>>> [elem * 2 for elem in a_list] ① [2, 18, 16, 8] ->>> a_list ② +>>> a_list ② [1, 9, 8, 4] ->>> a_list = [elem * 2 for elem in a_list] ③ +>>> a_list = [elem * 2 for elem in a_list] ③ >>> a_list [2, 18, 16, 8]