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

Eduardo Diaz
Eduardo Diaz
Courses Plus Student 6,048 Points

couldnt evaluate your script

im a little confused as to wether should i separate the elements in the tuple wth spaces or not, and i dont undestand why cant it evaluate script?

TILES = ('-', ' ', '-', ' ', '-', '||',
         '_', '|', '_', '|', '_', '|', '||',
         '&', ' ', '_', ' ', '||',
         ' ', ' ', ' ', '^', ' ', '||'

for tile in TILES:
    if title is not '||':
        print(title, end=' ')

Hey Eduardo:

Make sure that you spell your iterable the same throughout. In the for loop, you spell it 'tile' and in your if condition and print function, you spell it 'title'.

Hope this helps.

Hey Eduardo!

In the for loop you call the items inside TILES "tile" while in the if statement you call it "title". You need to call it with the same name. And you don't need to put a space in the end variable (with end='' is enough).

1 Answer

Seems like your question is still not answered, as it pops up in list of unanswered questions.

Besides what is mentioned by Eddy Hood and Emmanuel Jiménez, you also need to understand the difference between 'is' and '=='. Or in this case, 'is not' and '!='.

Is checks if the both variable are pointing to same object whereas == checks the value.

So may be this is what you need.

for tile in TILES:
    if tile != '||':
        print(tile, end=' ')

If this is not your answer and you already got the answer, post it and accept is by upvoting.

Enjoy coding.