Write a function that takes a DrawingPanel as a parameter and draws the horizontal pyramid shape as shown in the following figure. There are ten rectangles of increasing sizes filled with increasing shade of green color (increment of G by 20 while keeping R and B at 0). These rectangles should have the same width, and completely symetric with respect to the center horizontal line of the window. Each rectangle should have a blue outline. A sample run of the following main() function should result in the following graphics.
***python only***
Write a function that takes a DrawingPanel as a parameter and draws the horizontal pyramid shape as shown in the following figure. There are ten rectangles of increasing sizes
filled with increasing shade of green color (increment of G by 20 while keeping R and B at 0). These rectangles should have the same width, and completely symetric with respect to
the center horizontal line of the window. Each rectangle should have a blue outline. A sample run of the following main() function should result in the following graphics.
WIDTH = 300
HEIGHT = 300
###
# Your code here
###
def main() :
panel =Drawing Panel(WIDTH, HEIGHT)
draw_objects(panel)
panel.window.mainloop
if_name_ == '_main_' :
main()
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images