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 trialAndrew Bickham
1,461 Pointsdbl pipe line
im having trouble skipping over the dbl pipe lines; I can get them to start a new line but as far as skipping past them I cant quite seem to figure it out
TILES = ('-', ' ', '-', ' ', '-', '||',
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for t in TILES:
if t == "||":
print(t, end="\n")
else:
print(t, end="")
1 Answer
Josh Keenan
20,315 PointsI just had a go and made the same mistake you have, if it is a double pipe it wants you to JUST print a new line, not the double pipe and the newline:
TILES = ('-', ' ', '-', ' ', '-', '||',
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for char in TILES:
if char == "||":
print("\n")
else:
print(char, end="")
Andrew Bickham
1,461 PointsAndrew Bickham
1,461 Pointslol well that's refreshing, but could you possibly explain why this coding worked but not the first attempt. honestly I feel like there the same coding
also thank you for the help josh
Josh Keenan
20,315 PointsJosh Keenan
20,315 Pointsbecause it wants you to not print the actual character.
The challenge says print a new line if it is a double pipe, not print the double pipe then the new line like you have.
So this is what you should have had in there, the only mistake you made was misreading the question, which is something I think I do an awful lot myself.
Josh Keenan
20,315 PointsJosh Keenan
20,315 PointsHappy to help! Good luck and happy coding