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 trialRobert Zachara
1,304 PointsWhat am I doing wrong ?
I have problem with this task? Can anyone tell me what is wrong with my code and why?
TILES = ('-', ' ', '-', ' ', '-', ,
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for tile in TILES:
if tile != "||":
print(tile, end="")
else:
print("\n")
1 Answer
andren
28,558 PointsThe code you have added is completely fine, the issue is the part you removed. You removed the 6th item from the TILES
array (the last item on the first row). I assume you intended to copy it to paste it into your condition, but you ended up cutting it out instead.
Well regardless of how it happened, if you simply add it back in like this:
TILES = ('-', ' ', '-', ' ', '-', '||', # Added || back as the sixth item
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for tile in TILES:
if tile != "||":
print(tile, end="")
else:
print("\n")
Then your code will pass.
Robert Zachara
1,304 PointsRobert Zachara
1,304 PointsYup. Thank you very much!