今日の問題はこれ
https://paiza.jp/works/mondai/stdout_primer/stdout_primer__2dim_array_step1
・8,7,1,3を2*2の形で出力せよという問題
私は
偶数番目のときに改行、奇数番目のときに半スペと考えて下記の様に実装
N =[0,8,1,3]
for i in range(len(N)):
if (i + 1) % 2 == 1:
print(N[i],end=" ")
else:
print(N[i],end="\n")
ところが他にもあり
もっと簡単にできた
print("0 8¥n1 3")
うん、たしかにそうなんだよなぁ。。。
まあ数字4つだけだからな
まあ、それにしてもprint内でも改行コード使えるんやな