Advertisement
TristanSld

for loop in lists 3

Feb 21st, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 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: b.append(x*x)
  8. print b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement