Latest web development tutorials

Pythonは演習33、

Pythonの100リー Pythonの100リー

タイトル:カンマ区切りのリストを押します。

プログラム解析:なし。

ソースコード:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

L = [1,2,3,4,5]
s1 = ','.join(str(n) for n in L)
print s1

上の例の出力は、次のとおりです。

1,2,3,4,5

Pythonの100リー Pythonの100リー