[Tutor] help with alternate execution

wrobl1rt at cmich.edu wrobl1rt at cmich.edu
Tue Sep 29 18:59:34 CEST 2009


I'm trying to make a very simple example to show alternate execution... if a 
number is divisible by 3 it will say so and if it isnt, it will say so. Heres my 
program---- 

n= raw_input("enter a number= ")
def divisible(n):
    if n%3 == 0:
        print n, "is divisible by 3"
    else:
        print n, "is not divisible by 3"
print divisible

when I try it out, and enter 3, I get this------

enter a number= 3
<function divisible at 0x02CC06B0>
>>> 

I'm not sure why I am getting this and am not quite sure what this means... 
could someone explain what I am doing wrong here and why it is telling me 
this?


More information about the Tutor mailing list