如下的 Python 代码用于输出如下数字图形。横线处应填入的代码是( ) N = int(input()) for i in range(1, N + 1): for j in range(1, N + 1): if ______________________________________: print(1, end = " ") else: print(0, end = " ") print()

A:i == j and i == 1 and j == 1 and i == N and j == N
B:i == j or i == 1 or j == 1 or i == N or j == N
C:i == j or i == 0 or j == 0 or i == (N + 1) or j == (N + 1)
D:i == j and i == 1 and j == 1 and i == (N + 1) and j == (N + 1)
正确答案:B
试卷来源:202606 CCF-GESP编程能力等级认证Python二级真题