Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # map_like_loop.py
- import math
- data=[289,256,225,196,169,144]
- def square_root(num):
- return math.sqrt(num)
- square_root_list=list(map(square_root,data))
- print "The square root of the numbers respectively:",square_root_list
- # >>> 'The square root of the numbers respectively:', [17.0, 16.0, 15.0, 14.0, 13.0, 12.0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement