0
Why does it print in the next line instead of continuing in the same line after coma?
def do_two(f): f() f() def do_four(f): do_two (f) do_two (f) def print_beam(): print ('+ - - -',) def print_post(): print ('| ',) def print_beams(): do_two(print_beam) print('+') def print_posts(): do_two(print_post) print('|') def print_row(): print_beams() do_four(print_posts) def print_grid(): do_two(print_row) print_beams() print_grid()
3 Réponses
0
use print(' your str hear', end='')
0
becausw print works like this by default
0
so what about this statement from the book:"If the sequence ends with a comma, Python leaves the line unfinished, so the value printed next appears on the same line."