I need to print a simple chessboard in Python, and it has to have 8 rows and 8 columns.
This is what I have so far:
for each_row in range(0,8):
for each_column in range(0,8):
print(" ", end="")
for k in range(0, 8):
print("x", end="o")
print("")
It prints something like this:
xoxoxo
xoxoxo
xoxoxo
xoxoxo
but I want something like this:
xoxoxo
oxoxox
xoxoxo
oxoxox
You should use conditional if-else to print different pattern each rows
Input
Output