def grid(row, col):
"""version with string concatenation"""
sep = '\n' + '+---'*col + '+\n'
return sep + ('| '*col + '|' + sep)*row
print(grid(3,7))
No comments:
Post a Comment