Completed 4-9 Cube Comprehension
This commit is contained in:
parent
12d60b76bb
commit
0f9e39a6d2
7
Chapter_04/4-9_cubeComprehension.py
Normal file
7
Chapter_04/4-9_cubeComprehension.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Exercise 4-9 Cube Comprehension
|
||||||
|
# Learning Objective: Use List Comprehension to create list of first 10 cubes.
|
||||||
|
|
||||||
|
cubes = [value**3 for value in range(1, 11)]
|
||||||
|
print(cubes)
|
||||||
|
|
||||||
|
# Unbenownst to me, I had done that already in 4-8.
|
||||||
Loading…
x
Reference in New Issue
Block a user