for の使い方 python
Cやphpのようなforを使いたいとき。
あるシーケンスにわたってインデクスで反復を行うには、 range() と len() を次のように組み合わせます: >>> a = ['Mary', 'had', 'a', 'little', 'lamb'] >>> for i in range(len(a)): ... print i, a[i] ... 0 Mary 1 had 2 a 3 little 4 lamb
- Prev jsonを使う。python | Google App Engine
- Next UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 2-8: ordinal not in range(128) | Google App Engine
- Prev jsonを使う。python | Google App Engine
- Next UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 2-8: ordinal not in range(128) | Google App Engine