LoginSignup
0
1

リストの括弧を出力しない簡単な方法

Posted at

括弧が邪魔で提出できないんだが?

paizaの問題に慣れていないため課題の通りに処理するコードはかけても出力でうまくいかなかった

sample_list = [1,2,3,4,5]
print(sample_list)

>> [1,2,3,4,5]

括弧を外さないと正しい答えとして認識されない。

ここで*を出力したいリストの前に明記する

sample_list = [1,2,3,4,5]
print(*sample_list)

>> 1 2 3 4 5

知らなかった。。。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1