Question: Python skyline program: Write a program that uses turtle graphics to display a random skyline on the screen, similar in style to the two examples

Python skyline program:

Write a program that uses turtle graphics to display a random skyline on the screen, similar in style to the two examples shown below: Your program should implement the following specifications:

Exactly 6 buildings are drawn.

The width of each building is randomly picked by the computer and must fall in the range 30-130 pixels, inclusive.

The height of each building is randomly picked by the computer and must fall in the range 50-250 pixels, inclusive.

Each building has a random color, but each color component (R, G, B) must be at least 0.5.

Each building contains a grid of windows, each of which is 10x10 pixels in size and which is separated from neighboring pixels by 10 pixels.

The number of rows and columns in the grid of windows must be proportional to the height and width (respectively) of a building.

Each window is lit (yellow) or unlit (black) with a 50/50 percent chance.

There is a 25% chance that a building has an antenna on top. The antenna must be centered, as in the examples above. The antenna must have two parts, To implement this program you must write a function named drawBuilding that takes five parameters, in this order:

the x coordinate of the lower-left corner of the building

the y coordinate of the lower-left corner of the building

the width of the building

the height of the building

the fill_color of the building

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!