我当前的代码位于此处,其中包含我想要显示的模式
XOOOOOX
OXOOOXO
OOXOXOO
OOOXOOO
OOXOXOO
OXOOOXO
XOOOOOX
代码:
#starting from the 1st row and ending at the 8th row
for row in range (1, 8):
#within each row, starting from the 1st col and ending in the 8th col
for col in range(1, 8):
#decide what to print at the current location
if ((row - col)) == 0:
print("X", end="")
elif((row + 1)) == 0:
print("X", end="")
else:
print("O", end="")
#go onto the next row
print()
梵蒂冈之花
繁星coding
饮歌长啸
相关分类