0
0

More than 1 year has passed since last update.

paizaラーニング「指定された範囲・行数の数字の出力 Python3編」

Posted at

私の解答

n, k = map(int,input().split())
for _ in range(k):
    for i in range(1, n+1):
        if i == n:
            print(i)
        else:
            print(i, end=" ")

前の問題の解答例に倣ったので、同じでした。

解答例

n, k = map(int, input().split())
for _ in range(k):
    for i in range(1, n + 1):
        if i == n:
            print(i)
        else:
            print(i, end=" ")
0
0
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
0