Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created April 15, 2013 06:21
Show Gist options
  • Save yuuichi-fujioka/5386096 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/5386096 to your computer and use it in GitHub Desktop.
ループのサンプルいろいろ
# 単純なループ
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