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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Olga Pavlova](https://secure.gravatar.com/avatar/b50ff89ba9c5171739e7cf975624fe42?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Olga Pavlova
2,682 PointsDeprecationWarning
import logging
import random
logging.info("You won't see this")
logging.warn("OH NO")
player = {'location': None, 'path': []}
cells = [(0, 0), (0, 1), (0, 2),
(1, 0), (1, 1), (1, 2),
(2, 0), (2, 1), (2, 2)]
def get_locations():
monster = random.choice(cells)
door = random.choice(cells)
start = random.choice(cells)
if monster == door or monster == start or door == start:
monster, door, start = get_locations()
return monster, door, start
Error I get:
treehouse:~/workspace$ python dd_game.py
/home/treehouse/workspace/dd_game.py:5: DeprecationWarning: The 'warn' function is deprecated, us
e 'warning' instead
logging.warn("OH NO")
WARNING:root:OH NO
Welcome to the dungeon!
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsHave you tried replacing "logging.warn" with "logging.warning"? That's what the error seems to be suggesting.
I tried it myself and sure enough, that fixes the issue!
You forgot to link to or mention the course you are doing, but if this is something you did by following along with a video, you might want to report it to the Support folks. They may want to add something to the Teacher's Notes and you could get the "special Exterminator badge".
![Olga Pavlova](https://secure.gravatar.com/avatar/b50ff89ba9c5171739e7cf975624fe42?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Olga Pavlova
2,682 PointsThank you Steven! That has worked!