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 trialHideki Matsuura
3,860 PointsWhat did I do wrong?
Not sure what I did wrong. I run it in work spaces and get the desired output.
TILES = ('-', ' ', '-', ' ', '-', '||',
'_', '|', '_', '|', '_', '|', '||',
'&', ' ', '_', ' ', '||',
' ', ' ', ' ', '^', ' ', '||'
)
for tile in TILES:
if tile == '||':
print('\n')
else:
print(tile, end='')
1 Answer
Alexander Davison
65,469 PointsBy default the print
function prints a newline. Passing in a newline will print the newline you specified and the newline the print
function prints anyway.
Passing in no parameters to the print
function (when you are trying to print the newline) should do the trick
print('\n') # This prints TWO newlines. The challenge doesn't like this...
print() # This prints ONE newline. The challenge seems to expect this in your code :)
I hope this helps. ~Alex
Hideki Matsuura
3,860 PointsHideki Matsuura
3,860 PointsThanks
Thomas Helms
16,816 PointsThomas Helms
16,816 Points... I was so rageface at this challenge...
This helps. Thanks Alex.