Lab 4

def print_beam():
“””This function prints a beam”””
print (‘+ – – – – + – – – – +’),
def print_post():
“””This function prints the posts of a grid”””
print (‘| | |’)
def print_posts():
“””This functions prints all posts for grid”””
print_post()
print_post()
print_post()
print_post()
def print_grid():
“””This function prints the grid”””
print_beam()
print_posts()
print_beam()
print_posts()
print_beam()
print_grid()

This program is an example of “divide and conquer” which is a problem solving skill, that is, divide the problem into smaller sub problems that can be easily solved. Here i combined ‘+’, ‘-‘ and ‘|’ to create that grid.

Leave a Reply

Your email address will not be published. Required fields are marked *