[Tutor] Beginner question on classes

Corinne Landers corinne.landers at live.com
Wed Oct 23 09:25:42 CEST 2013


Hi guys, 
I need a bit of help. I'm writing a class, and in the main function I'm trying to say if this method gets called, do this. I'm trying things like:
program = AnimalClass(x,y,z)for i in range(x):   for j in range(y):      for k in range(z):      animal = program.animal()      if animal:           if isinstance(animal,moose):          print("There is a moose here")
It's clearly not correct because it's giving me all sorts of grief, but if anyone knows how to do this correctly I'd very much appreciate it!
Corrine
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131023/159fae44/attachment-0001.html>


More information about the Tutor mailing list