Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #question 7
- values = [3.45, 5.67, 7.89]
- #using list comprehension
- squares = [value **2 for value in values]
- print(squares)
- print()
- #using map function
- def squares(number):
- return number** 2
- print(list(map(squares, values)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement