全て、
次のリストがあります。
[「abc」、「def」、「ghi」]
そこから取得する必要があるのは文字列です。
"abc,def,ghi"
最初の要素と 2 番目の要素の間にコンマがありますが、文字列の末尾にはありません。
残念ながら、Python には次のような構造はありません。
std::string str;
for( int i = 0; i < 3; i++ )
{
str += list[i];
if( i != 2 )
str += ",";
}
Pythonでどのように行うのですか?