Created
April 15, 2013 06:21
-
-
Save yuuichi-fujioka/5386096 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
# 単純なループ | |
for i in range(5): | |
print i | |
''' | |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
''' | |
# ファイルを1行ずつ読む | |
for line in open('hoge.txt','r'): | |
print line | |
# 無限ループ | |
while true: | |
print 'yahoooo!!!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment