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

So in the Dungeon Game , he sets his player to NONE, what exactly does NONE mean? Is it like an empty list/tuple?

Dungeon Entrance with Kenneth Love

1 Answer

I suppose the only reason for setting monster, player and door to None is that he would still finish the function later. He actually sets all these 3 variables to a random (x, y) tuple, but he leaves the function like you mentioned because he want's to finish it later. He could also coded like this:

def get_location():
    pass

But he left the way he did because he wanted to make sure you knew that the idea of the function is to get a location for player, monster and door. The temporary value set (None) is so that the program can execute without any errors.

I hope I made myself clear. English is not my first language, so my grammar is not the best.

Yes, you made it perfectly clear! Thank you, I understand it now.