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 Object-Oriented Python (retired) Objects Instantiate

Drew Bissonnette
Drew Bissonnette
309 Points

How do I import without the console?

I am in the Challenge of import just Monster from monster. However, there is no console. How do I do this? I added the steps from the last task as it sated to.

my_monster.py
class Student:
  name = 'Drew'
  from monster import Monster
Drew Bissonnette
Drew Bissonnette
309 Points

I was able to find the answer and move on.

1 Answer

Hi Drew,

First you always want to import anything at the top of your code. If you want to only import the class Monster from monster.py, you should only need:

from monster import Monster

I tried and that worked for me. Remember to always user import at the top of your code.

They final answer for the entire challenge is:

from monster import Monster

troll = Monster()

If you have any question let me know.

Drew Bissonnette
Drew Bissonnette
309 Points

Thanks! I was able to figure it out finally. I am back tracking and starting with the Python basics track. I think it will help me out more with this track.