python的map遍历代码

  好久没有用python了,感觉基本的语法都生疏了,比如map的遍历:)

python 代码
 
  1. 例 6.10. 遍历 dictionary  
  2.   
  3. >>> import os  
  4. >>> for k, v in os.environ.items():      1 2  
  5. ...     print "%s=%s" % (k, v)  
  6. USERPROFILE=C:\Documents and Settings\mpilgrim  
  7. OS=Windows_NT  
  8. COMPUTERNAME=MPILGRIM  
  9. USERNAME=mpilgrim  
详细参考 www.woodpecker.org.cn/diveintopython/file_handling/for_loops.html

你可能感兴趣的:(python)