Last active
November 16, 2018 14:49
-
-
Save ChaitanyaBaweja/d51b2a896d761e9e5d83864f462b3db1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list = [1, 2, 3, 4] | |
cube_list = [] | |
for i in list: | |
cube_list.append(i**3) | |
print(cube_list) # Output: [1, 8, 27, 64] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Find cube of all numbers in a list and store them in a new list using a for loop.