0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

paizaラーニング「全要素の出力 Python3編」

Posted at

私の解答

a = [6, 5, 4, 3, 2, 1]
b = [3, 1, 8, 8, 1, 3]
for i in range(5):
    print(a[i],end=" ")
print(a[5])
for j in range(5):
    print(b[j],end=" ")
print(b[5])

私の解答はカッコ悪いですね。。。

解答例

li = [[6, 5, 4, 3, 2, 1], [3, 1, 8, 8, 1, 3]]

for i in range(len(li)):
    for j in range(len(li[i])):
        print(li[i][j], end="")

        if j < len(li[i]) - 1:
            print(end=" ")
        else:
            print()
0
0
1

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?