Reputation:
My function is:
def draw_map():
for row in list:
for tile in row:
print(tile, end=' ')
print('\n')
Output is:
_ _ _ o
/ \ O
\ /
‾ ‾ ‾
Output should be:
_ _ _ o
/ \ O
\ /
‾ ‾ ‾
Edit: Removing print('\n') makes the output:
_ _ _ o /\ O \ / ‾ ‾ ‾
So why is the one \n making it print on every other line?
Upvotes: 1
Views: 138
Reputation: 10306
print
has end="\n"
by default, so doing print("\n")
prints two newlines. I think you just mean to do print()
.
Upvotes: 8