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 trialMUZ140070 Nyasha L. Mupoperi
4,070 Pointstask 2 of 2
create an instance in monster called troll
class Monster (object):
justMonster = 1
from monster import Monster
8 Answers
james white
78,399 PointsNeither of these is very good responses..
With "import" I believe you are dealing with modules.
When dealing with an "instance" I believe you are dealing with a class?
Anyway here is what I figured out that seemed to pass:
The challenge is: http://teamtreehouse.com/library/instantiate
The two parts:
Challenge Task 1 of 2
Import just Monster from monster.
from monster import Monster
Challenge Task 2 of 2
Create an instance of Monster named troll.
from monster import Monster
troll = Monster()
Tony McCabe
4,889 PointsTroll = Monster passed for me
Mikael Enarsson
7,056 PointsI'm not certain of what you are asking. Do you want to know how to create instances of classes?
Kenneth Love
Treehouse Guest TeacherLooking at your badges, you jumped way ahead in Object-Oriented Python instead of starting at the beginning. Why don't you go back to the beginning of the course and start there? You'll have a lot fewer questions.
MUZ140082 mucheni
1,244 Pointsfrom monster import Monster
troll = Monster()
type(troll)
where am geting it wrong
Kenneth Love
Treehouse Guest TeacherWhy are your last two lines indented?
MUZ140082 mucheni
1,244 Pointsplease assist mi
MUZ140082 mucheni
1,244 Pointsthank you Kenneth i managed to surpass it
Trainer Workout
22,341 Pointstroll = Monster
Abdillah Hasny
Courses Plus Student 3,886 PointsAbdillah Hasny
Courses Plus Student 3,886 Pointsfor task 2 i create
but wrong hehe i think use
new
like javascript