Python is a scripting language as you know. It works a little bit different from what you might have experienced about C/C++/Java. In C/Cpp/Java you have a main class and or a main function available which is the point of start for the execution of the program. 
For python there is no language specified main function or class, you have to define your own class and call it also.
What you had done was just define the function without using it, so call the function.
Snippets:
import random
def rand_divis_3():
    num = random.randint(0,100)
    print num
    if num % 3 == 0:
        print True
    else:
        print False
This creates a function rand_divis_3, this is created and stored in the internal memory. The thing is you have to call the function.
>>>rand_divis_3()
93
Now this part is tricky, python is a language that literally has millions of libraries, you can find them at https://pypi.python.org, also you can create your own libraries.
Suppose you wrote this code 
import random
def rand_divis_3():
        num = random.randint(0,100)
        print num
        if num % 3 == 0:
            print True
        else:
            print False
rand_divis_3() #This is where the function is executed
you called this file.py and executed it as python file.py, that will ofcourse first import random, then create an object called rand_divis_3 and internally it points to the function. and when it will come to rand_divis_3(), it will execute this line, which will in effect generate a random number for you and print the number and True/False accordingly.
Suppose you need to create a library, then you have a problem, because when you  import file then the file.py script is executed from top to bottom.
To avoid this you can do 
- replace 
import file by from file import rand_divis_3,which selectively imports a function, though if you are working on some real project this isn't advisable, look #2 
at the end of the script add this line,
if name=='main': 
rand_divis_3()
 
With this line at the end of file.py, when you do python file.py it will call the function but if you do import file, the function rand_divis_3 will not be called.
The reason behind this is when name variable is main when you are executing any python script.
So your final file will look like this:
import random
def rand_divis_3():
        num = random.randint(0,100)
        print num
        if num % 3 == 0:
            print True
        else:
            print False
if __name__=='__main__':
   rand_divis_3() # function is called  only when you execute the script
Note: This is very important, what Cyber said works when you are learning the language to do few things, but when you get serious about programming this will come to handy, it had taken me a long time to realize it's importance.
I have a github repo created for python newbies here, http://github.com/thewhitetulip/SamplePythonScripts
     
    
rand_divis_3()function ?