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 trialMaiia Spivak
3,038 PointsWhy is it not working?
Please have a look at this challenge. Could you tell me what is wrong?
TILES = ('-', ' ', '-', ' ', '-', '||',
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for item in TILES:
if item != '||':
endline = ""
print(item, end=endline)
else:
endline = "\n"
print("\n", end=endline)
Maiia Spivak
3,038 PointsHi Brendan,
I was just looking into the answer, and still cannot get it. I tried to put two blank lines instead - does not work. Please advise.
Maiia
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsThere is some ambiguity in the challenge wording. A fully blank line is expected between printed characters. The short fix is to replace the else
block with a simple
else:
print('\n')
Maiia Spivak
3,038 PointsThanks a lot Chris!
Jason Anello
Courses Plus Student 94,610 PointsHi Maiia,
Your original code should have worked and it passes for me when I try it.
Chris' answer would be the more straightforward approach though.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsI think the question was edited.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsBrendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsCheck out this answer: https://teamtreehouse.com/community/what-am-i-doing-wrong-in-this-challenge-4