[Tutor] calling class instances in functions

Alan Gauld alan.gauld at btinternet.com
Wed Sep 12 09:59:00 CEST 2007

"Ara Kooser" <ghashsnaga at gmail.com> wrote

> In the main program at the function def add_yeast(world): I want to
> instance the class GoodYeast and have the global variable @ change 
> to
> G on the world. I tried just creating an instance but that did not 
> go
> over so well.

"did no go over so well" is not very useful to us.

Can you be a bit more specific?
How did you create the instance? What happened?
Did you get an error message? If so what?

Can you show us the specific code where you create the instance?
I don't see it in the code you posted? But theres rather a lot.
Can you show us a shorter example of what you are trying to do?

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list