I want to add a spacing infront of the question marks. But its in a loop, adding end=" " will just add more spacing between the question marks. I am curious if there is another method of doing it other than this without importing sys but instead use the print() method:
import sys
def display_board(board):
for rows in board:
sys.stdout.write(" "* 20)
for columns in rows:
# Display "?" for hidden cells and the actual letter for visible cells
sys.stdout.write(("?" if columns != "@" else "@"))
sys.stdout.write('\n')
Output:
?????????
?????????
?????????
?????????
?????????
?????????
?????????
?????????