Created
          May 15, 2017 15:51 
        
      - 
      
- 
        Save Everfighting/720c748d189fb3bdfecc7489a98f8bfe to your computer and use it in GitHub Desktop. 
    集合解析进行筛选
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | data = [2,-1,-3,6,8,2] | |
| s = set(data) | |
| # s= {2,-1,-3,6,8} | |
| results = {x for x in s for x % 3 == 0} | |
| # {-3,6} | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment