Advertisement
TristanSld

for loop in lists

Feb 21st, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3.  
  4. a = [1,3,8,-2,9,-5]
  5. b = []
  6.  
  7. for x in a:
  8.         b.append(x*x)
  9. print b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement