TristanSld

for loop in lists 2

Feb 21st, 2014
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3.  
  4. a = [1,3,8,-2,9,-5]
  5. b = [x*x for x in a if x>0]
  6. print b
RAW Paste Data