I am really stuck on this problem. I am supposed to write a function that takes in the number of rows of
the mountain range as a parameter. The function will then draw a number mountain range on screen using
the print function. There are X number of rows, but there are two 1s, four 2s,
six 3s, eight 4s, etc.

What code have you tried so far?

You would use a list of lists. One sub-list for each row, so if the data is 1, 3, 2, 7, 5 and you are drawing the third row, you would place an "X" in the element at offsets 1,3, and 4 since those 3 all require a third row. Once that is done you can just join and/or print each sublist.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.