diff --git a/Codecademy.md b/Codecademy.md index 99c34fa..de19028 100644 --- a/Codecademy.md +++ b/Codecademy.md @@ -300,6 +300,20 @@ You can manipulate lists with list comprehensions as well: fahrenheit = [celsius * (9 / 5) + 32 for celsius in celsius] ``` +### Print manipulated numbers in for loop +``` +single_digits = range(10) +squares = [] +cubes = [(num ** 3) for num in single_digits] + +for single_digits in single_digits: + print(single_digits) + squares.append(single_digits ** 2) + +print(squares) + +print(cubes) +``` ## Ranges You can get a range of numbers using `range()`