Ch6 Discussion 02

The cityscape function takes in a list of integers representing the heights of buildings and puts out a single string that will show skyscrapers built of X’s in columns whose heights correspond to the integers.

Example:

cityscape [4,2,6,1]

Output:

  x
  x
x x
x x
xxx
xxxx

Make sure you test your program to verify that it works with two skyscrapers of the same height.

Editing Checklist