Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Dungeon Game Line endings

What's wrong in my code!!!

it says 'Didn't get the right output' and i can't find the issue in my code

mapping.py
TILES = ('-', ' ', '-', ' ', '-', '||',
         '_', '|', '_', '|', '_', '|', '||',
         '&', ' ', '_', ' ', '||',
         ' ', ' ', ' ', '^', ' ', '||'
)

for tile in TILES:
    if tile == '||':
        print(tile, end="\n")
    else:
        print(tile, end="")

1 Answer

Greg Kaleka
Greg Kaleka
39,021 Points

Hi there,

That's not quite what the challenge is asking you to do. Here's what it says to do if there's a double pipe:

instead of printing the item, print a new line (\n).

So rather than printing the double pipes and then a new line, just print the new line. No double pipes should show up in the output.

Make sense?

Cheers :beers:

-Greg

I should read the question well in the next time :) thank you very much