| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「Python Range」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
1行目: 1行目:
 
==Pythoni Range==
 
==Pythoni Range==
[[Python]]
+
[[Python]] |
[[http://python.secsup.org/?p=47 Python Osmosis ]]
+
[[http://python.secsup.org/?p=47 Python Osmosis ]] |
  
 
===Range===
 
===Range===

2020年2月15日 (土) 08:38時点における版

Pythoni Range

Python | [Python Osmosis ] |

Range

  1. Python 2.6.3 (r263rc1:75186, Oct 2 2009, 20:40:30) [MSC v.1500 32 bit (Intel)] on win32
  2. Type "copyright", "credits" or "license()" for more information.
  3.  
  4. ****************************************************************
  5. Personal firewall software may warn about the connection IDLE
  6. makes to its subprocess using this computer's internal loopback
  7. interface. This connection is not visible on any external
  8. interface and no data is sent to or received from the Internet.
  9. ****************************************************************
  10. IDLE 2.6.3
  11. >>> range(10)
  12. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  13. >>> range(5, 10)
  14. [5, 6, 7, 8, 9]
  15. >>> range(0, 10, 3)
  16. [0, 3, 6, 9]
  17. >>> a = ['Mary', 'had', 'a', 'little', 'lamb']
  18. >>> for i in range(len(a)):
  19. print i, a[i]
  20.  
  21. 0 Mary
  22. 1 had
  23. 2 a
  24. 3 little
  25. 4 lamb
  26. >>>