AllenDowney / ThinkPython2

LaTeX source and supporting code for Think Python, 2nd edition, by Allen Downey.
Other
2.49k stars 1.65k forks source link

simple grid.py #108

Closed GarageTech closed 1 year ago

GarageTech commented 1 year ago

def half_line(s1, s2): print(s1, end=' ') print((s2 + ' ') * 4, end='')

def print_line(s1, s2): half_line(s1, s2) half_line(s1, s2) print(s1)

def print_four(s1, s2): print_line(s1, s2) print_line(s1, s2) print_line(s1, s2) print_line(s1, s2)

print_line('+', '-') print_four('|', ' ') print_line('+', '-') print_four('|', ' ') print_line('+', '-')

AllenDowney commented 1 year ago

Thanks!