Lab 4

I placed beams and posts to make columns and rows. By printing columns and rows together you shall get a chart or a table.

Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type “copyright”, “credits” or “license()” for more information.
>>> def print_beam():
“””This function prints a beam”””
print ‘+ – – – -‘,
>>> def print_post():
“””This function prints a post”””
print ‘| ‘,
>>> print_beam()
+ – – – –
>>> print_post()
|
>>> def print_beams():
“””This function print the beams of a grid”””
print_beam()
print_beam()
print ‘+’
>>> print_beams()
+ – – – – + – – – – +
>>> def print_posts():
“””This function print the posts of a grid”””
print_post()
print_post()
print ‘|’
>>> print_posts()
| | |
>>> def print_row():
“””This function print a row of the grid”””
print_beams()
print_posts()
print_posts()
print_posts()
print_posts()
>>> print_row()
+ – – – – + – – – – +
| | |
| | |
| | |
| | |
>>>