[Tutor] <function animals at 0x662f0> what does it mean?
Kristinn Didriksson
kdidriksson at gmail.com
Mon Nov 13 17:51:01 CET 2006
Hello,
This is my first program calling functions :)
It worked nicely except for the message above. Can anyone explain
what the message means.
Thanks,
Kristinn
Program
-----------------------------
# a program that prints the lyrics for Old Mcdonal had a farm for 5
different animals.
# this will have two functions: oldMac and animals
# two functions will be passed: animal and sound
def animals(animal, sound):
# print out the lyrics calling the subroutine for aminals
print "Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!"
print "And on the farm he had a ", animal + ", Ee-igh, Ee-igh, Oh!"
print "With a", sound + ",", sound, "here and a" , sound + ",",
sound + " there."
print "Here a", sound + ", there a", sound + ", everyehere a", sound
+ ",", sound + "."
print "Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!"
print
return animals
def oldMac():
print animals("cow", "moo")
print animals("pig", "oink")
print animals("horse", "neigh")
print animals("dog", "woof")
print animals("cat", "meow")
oldMac()
------------------------------
Output
-----------------------------
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
And on the farm he had a cow, Ee-igh, Ee-igh, Oh!
With a moo, moo here and a moo, moo there.
Here a moo, there a moo, everyehere a moo, moo.
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
<function animals at 0x66030>
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
And on the farm he had a pig, Ee-igh, Ee-igh, Oh!
With a oink, oink here and a oink, oink there.
Here a oink, there a oink, everyehere a oink, oink.
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
<function animals at 0x66030>
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
And on the farm he had a horse, Ee-igh, Ee-igh, Oh!
With a neigh, neigh here and a neigh, neigh there.
Here a neigh, there a neigh, everyehere a neigh, neigh.
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
<function animals at 0x66030>
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
And on the farm he had a dog, Ee-igh, Ee-igh, Oh!
With a woof, woof here and a woof, woof there.
Here a woof, there a woof, everyehere a woof, woof.
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
<function animals at 0x66030>
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
And on the farm he had a cat, Ee-igh, Ee-igh, Oh!
With a meow, meow here and a meow, meow there.
Here a meow, there a meow, everyehere a meow, meow.
Old MacDonald had a farm, Ee-igh, Ee-igh, Oh!
<function animals at 0x66030>
-------------------------------
More information about the Tutor
mailing list